*/
function wfUrlencode( $s ) {
static $needle;
+ if ( is_null( $s ) ) {
+ $needle = null;
+ return;
+ }
+
if ( is_null( $needle ) ) {
$needle = array( '%3B', '%40', '%24', '%21', '%2A', '%28', '%29', '%2C', '%2F' );
if ( !isset( $_SERVER['SERVER_SOFTWARE'] ) || ( strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7' ) === false ) ) {
: null
;
$_SERVER['SERVER_SOFTWARE'] = $server;
+ wfUrlencode( null );
// do the requested test
$this->assertEquals(
} else {
$_SERVER['SERVER_SOFTWARE'] = $old;
}
+ wfUrlencode( null );
}
/**
if( is_string( $expectations ) ) {
return $expectations;
} elseif( is_array( $expectations ) ) {
-
- /**
- * FIXME FIXME FIXME FIXME
- * wfUrlencode use a static variable so we can not just
- * change the $GLOBALS server name :(
- */
- $this->markTestSkipped( 'FIXME: wfUrlencode() use a static, thus changing $GLOBALS[SERVER_SOFTWARE] is useless' );
-
if( !array_key_exists( $server, $expectations ) ) {
throw new MWException( __METHOD__ . " expectation does not have any value for server name $server. Check the provider array.\n" );
} else {