From: Rob Church Date: Sun, 29 Jul 2007 16:50:40 +0000 (+0000) Subject: strpos() !== false is faster than strstr() X-Git-Tag: 1.31.0-rc.0~51949 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=b8f8c25260fcf65214ad7db2c0409c227b6edf58;p=lhc%2Fweb%2Fwiklou.git strpos() !== false is faster than strstr() --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index d93436eed4..66e8ba68db 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -554,7 +554,7 @@ EOT $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) ); return; } - if ( strstr( $oldimage, "/" ) || strstr( $oldimage, "\\" ) ) { + if( strpos( $oldimage, '/' ) !== false || strpos( $oldimage, '\\' ) !== false ) { $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) ); return; }