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:
1dda2c8
)
Per comments on code review, use JSON instead of PHP serialization for Abuse Filter...
author
Andrew Garrett
<werdna@users.mediawiki.org>
Tue, 2 Jun 2009 12:59:05 +0000
(12:59 +0000)
committer
Andrew Garrett
<werdna@users.mediawiki.org>
Tue, 2 Jun 2009 12:59:05 +0000
(12:59 +0000)
includes/GlobalFunctions.php
patch
|
blob
|
history
diff --git
a/includes/GlobalFunctions.php
b/includes/GlobalFunctions.php
index
26b75bf
..
41d4a6f
100644
(file)
--- a/
includes/GlobalFunctions.php
+++ b/
includes/GlobalFunctions.php
@@
-3127,3
+3127,17
@@
function wfArrayInsertAfter( $array, $insert, $after ) {
return $output;
}
+
+/* Recursively converts the parameter (an object) to an array with the same data */
+function wfObjectToArray( $object, $recursive = true ) {
+ $array = array();
+ foreach ( get_object_vars($object) as $key => $value ) {
+ if ( is_object($value) && $recursive ) {
+ $value = wfObjectToArray( $value );
+ }
+
+ $array[$key] = $value;
+ }
+
+ return $array;
+}