diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index f027869fa..999ce65dd 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -598,7 +598,7 @@ function wp_rel_nofollow( $text ) {
global $wpdb;
// This is a pre save filter, so text is already escaped.
$text = stripslashes($text);
- $text = preg_replace('||i', '', $text);
+ $text = preg_replace('||ie', "''", $text);
$text = $wpdb->escape($text);
return $text;
}