Escape delimiter in SpecialPage::prefixSearchArray
authorChad Horohoe <chadh@wikimedia.org>
Thu, 26 Jun 2014 19:45:40 +0000 (12:45 -0700)
committerParent5446 <tylerromeo@gmail.com>
Thu, 26 Jun 2014 19:50:57 +0000 (19:50 +0000)
Changed preg_quote() call so that the proper delimiter
is passed as the second parameter, thus making sure
it is properly escaped.

Change-Id: Ie12418e5433642b86dcda425b63a05ac3ff2c29d

includes/specialpage/SpecialPage.php

index 302e408..f968276 100644 (file)
@@ -346,7 +346,7 @@ class SpecialPage {
         * @return string[]
         */
        protected static function prefixSearchArray( $search, $limit, array $subpages ) {
-               $escaped = preg_quote( $search );
+               $escaped = preg_quote( $search, '/' );
                return array_slice( preg_grep( "/^$escaped/i", $subpages ), 0, $limit );
        }