Index: branches/REL1_12/phase3/includes/GlobalFunctions.php |
— | — | @@ -1952,6 +1952,28 @@ |
1953 | 1953 | } |
1954 | 1954 | |
1955 | 1955 | /** |
| 1956 | + * array_merge() does awful things with "numeric" indexes, including |
| 1957 | + * string indexes when happen to look like integers. When we want |
| 1958 | + * to merge arrays with arbitrary string indexes, we don't want our |
| 1959 | + * arrays to be randomly corrupted just because some of them consist |
| 1960 | + * of numbers. |
| 1961 | + * |
| 1962 | + * Fuck you, PHP. Fuck you in the ear! |
| 1963 | + * |
| 1964 | + * @param array $array1, [$array2, [...]] |
| 1965 | + * @return array |
| 1966 | + */ |
| 1967 | +function wfArrayMerge( $array1/* ... */ ) { |
| 1968 | + $out = $array1; |
| 1969 | + for( $i = 1; $i < func_num_args(); $i++ ) { |
| 1970 | + foreach( func_get_arg( $i ) as $key => $value ) { |
| 1971 | + $out[$key] = $value; |
| 1972 | + } |
| 1973 | + } |
| 1974 | + return $out; |
| 1975 | +} |
| 1976 | + |
| 1977 | +/** |
1956 | 1978 | * Make a URL index, appropriate for the el_index field of externallinks. |
1957 | 1979 | */ |
1958 | 1980 | function wfMakeUrlIndex( $url ) { |
Index: branches/REL1_12/phase3/includes/WebRequest.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | |
54 | 54 | // POST overrides GET data |
55 | 55 | // We don't use $_REQUEST here to avoid interference from cookies... |
56 | | - $this->data = array_merge( $_GET, $_POST ); |
| 56 | + $this->data = wfArrayMerge( $_GET, $_POST ); |
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
Index: branches/REL1_12/phase3/trackback.php |
— | — | @@ -11,8 +11,7 @@ |
12 | 12 | */ |
13 | 13 | function XMLsuccess() { |
14 | 14 | header("Content-Type: application/xml; charset=utf-8"); |
15 | | - echo " |
16 | | -<?xml version=\"1.0\" encoding=\"utf-8\"?> |
| 15 | + echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> |
17 | 16 | <response> |
18 | 17 | <error>0</error> |
19 | 18 | </response> |
— | — | @@ -23,8 +22,7 @@ |
24 | 23 | function XMLerror($err = "Invalid request.") { |
25 | 24 | header("HTTP/1.0 400 Bad Request"); |
26 | 25 | header("Content-Type: application/xml; charset=utf-8"); |
27 | | - echo " |
28 | | -<?xml version=\"1.0\" encoding=\"utf-8\"?> |
| 26 | + echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> |
29 | 27 | <response> |
30 | 28 | <error>1</error> |
31 | 29 | <message>Invalid request: $err</message> |
Index: branches/REL1_12/phase3/RELEASE-NOTES |
— | — | @@ -397,6 +397,8 @@ |
398 | 398 | * (bug 13005) DISPLAYTITLE does not work on preview |
399 | 399 | * (bug 13004) Fix error on Postgres searches that return too many results. |
400 | 400 | * (bug 13022) Fix upload from URL on PHP 5.0.x |
| 401 | +* (bug 13139, 13074) Fix request data for parameters with numeric names |
| 402 | +* (bug 13086) Trackbacks were returning invalid XML (extra whitespace) |
401 | 403 | |
402 | 404 | == Parser changes in 1.12 == |
403 | 405 | |