Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -74,6 +74,8 @@ |
75 | 75 | * (bug 28649) Avoiding half truncated multi-byte unicode characters when |
76 | 76 | truncating log comments. |
77 | 77 | * Show --batch-size option in help of maintenance scripts that support it |
| 78 | +* (bug 4381) Magic quotes cleaning is not comprehensive, key strings not |
| 79 | + unescaped |
78 | 80 | |
79 | 81 | === API changes in 1.19 === |
80 | 82 | * (bug 19838) siprop=interwikimap can now use the interwiki cache. |
Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -239,16 +239,21 @@ |
240 | 240 | * used for undoing the evil that is magic_quotes_gpc. |
241 | 241 | * |
242 | 242 | * @param $arr array: will be modified |
| 243 | + * @param $recursion bool Used to modify behaviour based on recursion |
243 | 244 | * @return array the original array |
244 | 245 | */ |
245 | | - private function &fix_magic_quotes( &$arr ) { |
| 246 | + private function &fix_magic_quotes( &$arr, $recursion = false ) { |
| 247 | + $clean = array(); |
246 | 248 | foreach( $arr as $key => $val ) { |
247 | 249 | if( is_array( $val ) ) { |
248 | | - $this->fix_magic_quotes( $arr[$key] ); |
| 250 | + $cleanKey = !$recursion ? stripslashes( $key ) : $key; |
| 251 | + $clean[$cleanKey] = $this->fix_magic_quotes( $arr[$key], true ); |
249 | 252 | } else { |
250 | | - $arr[$key] = stripslashes( $val ); |
| 253 | + $cleanKey = stripslashes( $key ); |
| 254 | + $clean[$cleanKey] = stripslashes( $val ); |
251 | 255 | } |
252 | 256 | } |
| 257 | + $arr = $clean; |
253 | 258 | return $arr; |
254 | 259 | } |
255 | 260 | |