The regex used to find hooks is too strict, as it assumes that strings are enclosed in single quotes,
which is not always true for wfRunHooks in the Mediawiki code base.
The trivial patch:
- a/maintenance/findhooks.php
+++ b/maintenance/findhooks.php
@@ -45,8 +45,8 @@ function getHooksFromDoc() {
function getHooksFromFile( $file ) {
$content = file_get_contents( $file ); $m = array();
- preg_match_all( "/wfRunHooks\(\s*\'(.*?)\'/", $content, $m);
- return $m[1];
+ preg_match_all( '/wfRunHooks\(\s*([\'"])(.*?)\1/', $content, $m);
+ return $m[2];
}
/**
Version: 1.12.x
Severity: trivial