Use a better regular expression to find documented hooks in findHooks.php
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 15 Dec 2013 13:55:39 +0000 (14:55 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 15 Dec 2013 13:55:39 +0000 (14:55 +0100)
Added a ":" after the second quote so that only strings in the form
'Hook': are matched, otherwise the line 1172 of hooks.txt provoques the
the following message:
Documented and not found: value
because the line starts with 'value'.

Change-Id: I1d603e3fa10dcabf25e31f6a71aad233571738b5

maintenance/findHooks.php

index a936436..24b23d9 100644 (file)
@@ -142,7 +142,7 @@ class FindHooks extends Maintenance {
        private function getHooksFromLocalDoc( $doc ) {
                        $m = array();
                        $content = file_get_contents( $doc );
-                       preg_match_all( "/\n'(.*?)'/", $content, $m );
+                       preg_match_all( "/\n'(.*?)':/", $content, $m );
                        return array_unique( $m[1] );
        }