File: 008trac-4804.patch

package info (click to toggle)
wordpress 2.0.10-1etch6
  • links: PTS
  • area: main
  • in suites: etch
  • size: 3,040 kB
  • ctags: 7,377
  • sloc: php: 26,382; sh: 4,645; makefile: 23
file content (28 lines) | stat: -rw-r--r-- 1,417 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh /usr/share/dpatch/dpatch-run
## trac 4804.dpatch by  <andrea.de.iacovo@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix for trac #4804

@DPATCH@

--- wordpress-etch/wp-includes/functions-formatting.php	2007-03-24 00:33:19.000000000 +0100
+++ wordpress-etch/wp-includes/functions-formatting.php	2008-04-22 11:42:10.000000000 +0200
@@ -20,7 +20,7 @@
 			// if a plugin has provided an autocorrect array, use it
 			if ( isset($wp_cockneyreplace) ) {
 				$cockney = array_keys($wp_cockneyreplace);
-				$cockney_replace = array_values($wp_cockneyreplace);
+				$cockneyreplace = array_values($wp_cockneyreplace);
 			} else {
 				$cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");
 				$cockneyreplace = array("&#8217;tain&#8217;t","&#8217;twere","&#8217;twas","&#8217;tis","&#8217;twill","&#8217;til","&#8217;bout","&#8217;nuff","&#8217;round","&#8217;cause");
@@ -1067,7 +1067,7 @@
 // Escape single quotes, specialchar double quotes, and fix line endings.
 function js_escape($text) {
 	$safe_text = wp_specialchars($text, 'double');
-	$safe_text = str_replace('&#039;', "'", $safe_text);
+	$safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text));
 	$safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text));
 	return apply_filters('js_escape', $safe_text, $text);
 }