r94674 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94673‎ | r94674 | r94675 >
Date:18:41, 16 August 2011
Author:robin
Status:resolved
Tags:
Comment:
Use slash as second paramter for preg_quote(), per CR on r94482
Modified paths:
  • /trunk/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php
@@ -114,10 +114,10 @@
115115 }
116116 }
117117 global $wmincProjects, $wmincSisterProjects;
118 - $listProjects = array_map( 'preg_quote', array_keys( $wmincProjects ) );
 118+ $listProjects = array_map( 'self::preg_quote_slash', array_keys( $wmincProjects ) );
119119 if( $allowSister && is_array( $wmincSisterProjects ) ) {
120120 # join the project codes with those of the sister projects
121 - $listSister = array_map( 'preg_quote', array_keys( $wmincSisterProjects ) );
 121+ $listSister = array_map( 'self::preg_quote_slash', array_keys( $wmincSisterProjects ) );
122122 $listProjects = array_merge( $listProjects, $listSister );
123123 }
124124 $listProjects = implode( '|', $listProjects );
@@ -283,7 +283,7 @@
284284 global $wmincTestWikiNamespaces, $wmincProjectSite, $wmincPseudoCategoryNSes;
285285 $prefixdata = self::analyzePrefix( $title->getText() );
286286 $ns = $title->getNamespace();
287 - $categories = array_map( 'preg_quote', $wmincPseudoCategoryNSes );
 287+ $categories = array_map( 'self::preg_quote_slash', $wmincPseudoCategoryNSes );
288288 if( !$prefixdata['error'] ) {
289289 # no error in prefix -> no error to show
290290 return false;
@@ -699,4 +699,8 @@
700700 $pageLang = $prefix['lang'];
701701 return true;
702702 }
 703+
 704+ private static function preg_quote_slash( $str ) {
 705+ return preg_quote( $str, '/' );
 706+ }
703707 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r94749Followup r94674: using 'self::foo' as a callback doesn't work in PHP 5.2 (whi...catrope12:35, 17 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94482Follow-up r92559:...robin22:17, 14 August 2011

Status & tagging log