Support short array syntax in findHooks.php
authorChad Horohoe <chadh@wikimedia.org>
Fri, 10 Jun 2016 20:28:24 +0000 (13:28 -0700)
committerChad <chadh@wikimedia.org>
Mon, 13 Jun 2016 21:23:39 +0000 (21:23 +0000)
Bug: T135257
Change-Id: I19d4f073ff730821230ccb28d29df303fbaccbc2

maintenance/findHooks.php

index 7304a2a..c91d824 100644 (file)
@@ -244,11 +244,11 @@ class FindHooks extends Maintenance {
                                // Comma for second argument
                                '(?:\s*(,))?' .
                                // Second argument must start with array to be processed
-                               '(?:\s*array\s*\(' .
+                               '(?:\s*(?:array\s*\(|\[)' .
                                // Matching inside array - allows one deep of brackets
-                               '((?:[^\(\)]|\([^\(\)]*\))*)' .
+                               '((?:[^\(\)\[\]]|\((?-1)\)|\[(?-1)\])*)' .
                                // End
-                               '\))?/',
+                               '[\)\]])?/',
                        $content,
                        $m,
                        PREG_SET_ORDER