diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index 701af8de4a..79002ff9ca 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -324,25 +324,9 @@ function get_the_content( $more_link_text = null, $strip_teaser = false ) { } } - if ( $preview ) // Preview fix for JavaScript bug with foreign languages. - $output = preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output ); - return $output; } -/** - * Preview fix for JavaScript bug with foreign languages. - * - * @since 3.1.0 - * @access private - * - * @param array $match Match array from preg_replace_callback. - * @return string - */ -function _convert_urlencoded_to_entities( $match ) { - return '&#' . base_convert( $match[1], 16, 10 ) . ';'; -} - /** * Display the post excerpt. * diff --git a/tests/phpunit/data/formatting/utf-8/entitize.py b/tests/phpunit/data/formatting/utf-8/entitize.py deleted file mode 100644 index efa7cb18d5..0000000000 --- a/tests/phpunit/data/formatting/utf-8/entitize.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generates entitized.txt from utf-8.txt -# -# entitized.txt is used by Tests_Formatting_UrlEncodedToEntities - -import codecs -import sys - -def entitize(line): - """Convert text to &#[dec]; entities.""" - line = line.strip(); - line = ["&#%d;" % ord(s) for s in line] - return "".join(line) - -if __name__ == "__main__": - args = sys.argv[1:] - if args and args[0] in ("-h", "--help"): - print "Usage: python entitize.py < utf-8.txt > entitized.txt" - sys.exit(2) - - sys.stdin = codecs.getreader("utf-8")(sys.stdin) - sys.stdout = codecs.getwriter("ascii")(sys.stdout) - - lines = sys.stdin.readlines() - sys.stdout.write( "\n".join(map(entitize, lines)) ) diff --git a/tests/phpunit/data/formatting/utf-8/entitized.txt b/tests/phpunit/data/formatting/utf-8/entitized.txt deleted file mode 100644 index 93d897585f..0000000000 --- a/tests/phpunit/data/formatting/utf-8/entitized.txt +++ /dev/null @@ -1,6 +0,0 @@ -章子怡 -François Truffaut -საქართველო -Björk Guðmundsdóttir -宮崎 駿 -👍 \ No newline at end of file diff --git a/tests/phpunit/data/formatting/utf-8/u-urlencode.py b/tests/phpunit/data/formatting/utf-8/u-urlencode.py deleted file mode 100644 index c20a14f1f8..0000000000 --- a/tests/phpunit/data/formatting/utf-8/u-urlencode.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generates u-urlencoded.txt from utf-8.txt -# -# u-urlencoded.txt is used by Tests_Formatting_UrlEncodedToEntities - -import codecs -import sys - -def uurlencode(line): - """Use %u[hexvalue] percent encoding.""" - line = line.strip() - line = ["%%u%04X" % ord(s) for s in line] - return "".join(line) - -if __name__ == "__main__": - args = sys.argv[1:] - if args and args[0] in ("-h", "--help"): - print "Usage: python u-urlencode.py < utf-8.txt > u-urlencoded.txt" - sys.exit(2) - - sys.stdin = codecs.getreader("utf-8")(sys.stdin) - sys.stdout = codecs.getwriter("ascii")(sys.stdout) - - lines = sys.stdin.readlines() - sys.stdout.write( "\n".join(map(uurlencode, lines)) ) diff --git a/tests/phpunit/data/formatting/utf-8/u-urlencoded.txt b/tests/phpunit/data/formatting/utf-8/u-urlencoded.txt deleted file mode 100644 index d6f77fdc3f..0000000000 --- a/tests/phpunit/data/formatting/utf-8/u-urlencoded.txt +++ /dev/null @@ -1,6 +0,0 @@ -%u7AE0%u5B50%u6021 -%u0046%u0072%u0061%u006E%u00E7%u006F%u0069%u0073%u0020%u0054%u0072%u0075%u0066%u0066%u0061%u0075%u0074 -%u10E1%u10D0%u10E5%u10D0%u10E0%u10D7%u10D5%u10D4%u10DA%u10DD -%u0042%u006A%u00F6%u0072%u006B%u0020%u0047%u0075%u00F0%u006D%u0075%u006E%u0064%u0073%u0064%u00F3%u0074%u0074%u0069%u0072 -%u5BAE%u5D0E%u3000%u99FF -%u1F44D \ No newline at end of file diff --git a/tests/phpunit/tests/formatting/UrlEncodedToEntities.php b/tests/phpunit/tests/formatting/UrlEncodedToEntities.php deleted file mode 100644 index e680352725..0000000000 --- a/tests/phpunit/tests/formatting/UrlEncodedToEntities.php +++ /dev/null @@ -1,24 +0,0 @@ -assertEquals( $entity, preg_replace_callback('/\%u([0-9A-F]{4,5})/', '_convert_urlencoded_to_entities', $u_urlencoded ), $entity ); - } - - function data() { - $input = file( DIR_TESTDATA . '/formatting/utf-8/u-urlencoded.txt' ); - $output = file( DIR_TESTDATA . '/formatting/utf-8/entitized.txt' ); - $data_provided = array(); - foreach ( $input as $key => $value ) { - $data_provided[] = array( trim( $value ), trim( $output[ $key ] ) ); - } - return $data_provided; - } -} -