Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php |
— | — | @@ -114,10 +114,10 @@ |
115 | 115 | } |
116 | 116 | } |
117 | 117 | global $wmincProjects, $wmincSisterProjects; |
118 | | - $listProjects = array_map( 'preg_quote', array_keys( $wmincProjects ) ); |
| 118 | + $listProjects = array_map( 'self::preg_quote_slash', array_keys( $wmincProjects ) ); |
119 | 119 | if( $allowSister && is_array( $wmincSisterProjects ) ) { |
120 | 120 | # 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 ) ); |
122 | 122 | $listProjects = array_merge( $listProjects, $listSister ); |
123 | 123 | } |
124 | 124 | $listProjects = implode( '|', $listProjects ); |
— | — | @@ -283,7 +283,7 @@ |
284 | 284 | global $wmincTestWikiNamespaces, $wmincProjectSite, $wmincPseudoCategoryNSes; |
285 | 285 | $prefixdata = self::analyzePrefix( $title->getText() ); |
286 | 286 | $ns = $title->getNamespace(); |
287 | | - $categories = array_map( 'preg_quote', $wmincPseudoCategoryNSes ); |
| 287 | + $categories = array_map( 'self::preg_quote_slash', $wmincPseudoCategoryNSes ); |
288 | 288 | if( !$prefixdata['error'] ) { |
289 | 289 | # no error in prefix -> no error to show |
290 | 290 | return false; |
— | — | @@ -699,4 +699,8 @@ |
700 | 700 | $pageLang = $prefix['lang']; |
701 | 701 | return true; |
702 | 702 | } |
| 703 | + |
| 704 | + private static function preg_quote_slash( $str ) { |
| 705 | + return preg_quote( $str, '/' ); |
| 706 | + } |
703 | 707 | } |