r65664 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65663‎ | r65664 | r65665 >
Date:19:06, 29 April 2010
Author:demon
Status:ok
Tags:
Comment:
Kill 5.0.x compat functions, we require 5.1+ anyway
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -172,54 +172,6 @@
173173 }
174174 }
175175
176 -if ( !function_exists( 'array_diff_key' ) ) {
177 - /**
178 - * Exists in PHP 5.1.0+
179 - * Not quite compatible, two-argument version only
180 - * Null values will cause problems due to this use of isset()
181 - */
182 - function array_diff_key( $left, $right ) {
183 - $result = $left;
184 - foreach ( $left as $key => $unused ) {
185 - if ( isset( $right[$key] ) ) {
186 - unset( $result[$key] );
187 - }
188 - }
189 - return $result;
190 - }
191 -}
192 -
193 -if ( !function_exists( 'array_intersect_key' ) ) {
194 - /**
195 - * Exists in 5.1.0+
196 - * Define our own array_intersect_key function
197 - */
198 - function array_intersect_key( $isec, $keys ) {
199 - $argc = func_num_args();
200 -
201 - if ( $argc > 2 ) {
202 - for ( $i = 1; $isec && $i < $argc; $i++ ) {
203 - $arr = func_get_arg( $i );
204 -
205 - foreach ( array_keys( $isec ) as $key ) {
206 - if ( !isset( $arr[$key] ) )
207 - unset( $isec[$key] );
208 - }
209 - }
210 -
211 - return $isec;
212 - } else {
213 - $res = array();
214 - foreach ( array_keys( $isec ) as $key ) {
215 - if ( isset( $keys[$key] ) )
216 - $res[$key] = $isec[$key];
217 - }
218 -
219 - return $res;
220 - }
221 - }
222 -}
223 -
224176 // Support for Wietse Venema's taint feature
225177 if ( !function_exists( 'istainted' ) ) {
226178 function istainted( $var ) {

Status & tagging log