dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e0a6ac2
)
Followup r95921, clearer PHPDoc and better variable names per CR
author
John Du Hart
<johnduhart@users.mediawiki.org>
Thu, 29 Sep 2011 20:21:32 +0000
(20:21 +0000)
committer
John Du Hart
<johnduhart@users.mediawiki.org>
Thu, 29 Sep 2011 20:21:32 +0000
(20:21 +0000)
includes/WebRequest.php
patch
|
blob
|
history
diff --git
a/includes/WebRequest.php
b/includes/WebRequest.php
index
2abc3d2
..
84e7e78
100644
(file)
--- a/
includes/WebRequest.php
+++ b/
includes/WebRequest.php
@@
-239,15
+239,18
@@
class WebRequest {
* used for undoing the evil that is magic_quotes_gpc.
*
* @param $arr array: will be modified
* used for undoing the evil that is magic_quotes_gpc.
*
* @param $arr array: will be modified
- * @param $recursion bool Used to modify behaviour based on recursion
+ * @param $topLevel bool Specifies if the array passed is from the top
+ * level of the source. In PHP5 magic_quotes only escapes the first level
+ * of keys that belong to an array.
* @return array the original array
* @return array the original array
+ * @see http://www.php.net/manual/en/function.get-magic-quotes-gpc.php#49612
*/
*/
- private function &fix_magic_quotes( &$arr, $
recursion = fals
e ) {
+ private function &fix_magic_quotes( &$arr, $
topLevel = tru
e ) {
$clean = array();
foreach( $arr as $key => $val ) {
if( is_array( $val ) ) {
$clean = array();
foreach( $arr as $key => $val ) {
if( is_array( $val ) ) {
- $cleanKey =
!$recursion
? stripslashes( $key ) : $key;
- $clean[$cleanKey] = $this->fix_magic_quotes( $arr[$key],
tru
e );
+ $cleanKey =
$topLevel
? stripslashes( $key ) : $key;
+ $clean[$cleanKey] = $this->fix_magic_quotes( $arr[$key],
fals
e );
} else {
$cleanKey = stripslashes( $key );
$clean[$cleanKey] = stripslashes( $val );
} else {
$cleanKey = stripslashes( $key );
$clean[$cleanKey] = stripslashes( $val );