Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1980,6 +1980,28 @@ |
1981 | 1981 | } |
1982 | 1982 | |
1983 | 1983 | /** |
| 1984 | + * array_merge() does awful things with "numeric" indexes, including |
| 1985 | + * string indexes when happen to look like integers. When we want |
| 1986 | + * to merge arrays with arbitrary string indexes, we don't want our |
| 1987 | + * arrays to be randomly corrupted just because some of them consist |
| 1988 | + * of numbers. |
| 1989 | + * |
| 1990 | + * Fuck you, PHP. Fuck you in the ear! |
| 1991 | + * |
| 1992 | + * @param array $array1, [$array2, [...]] |
| 1993 | + * @return array |
| 1994 | + */ |
| 1995 | +function wfArrayMerge( $array1/* ... */ ) { |
| 1996 | + $out = $array1; |
| 1997 | + for( $i = 1; $i < func_num_args(); $i++ ) { |
| 1998 | + foreach( func_get_arg( $i ) as $key => $value ) { |
| 1999 | + $out[$key] = $value; |
| 2000 | + } |
| 2001 | + } |
| 2002 | + return $out; |
| 2003 | +} |
| 2004 | + |
| 2005 | +/** |
1984 | 2006 | * Make a URL index, appropriate for the el_index field of externallinks. |
1985 | 2007 | */ |
1986 | 2008 | function wfMakeUrlIndex( $url ) { |
Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | |
56 | 56 | // POST overrides GET data |
57 | 57 | // We don't use $_REQUEST here to avoid interference from cookies... |
58 | | - $this->data = array_merge( $_GET, $_POST ); |
| 58 | + $this->data = wfArrayMerge( $_GET, $_POST ); |
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |