Skip to content

Commit

Permalink
// do not include invalid hooks in results
Browse files Browse the repository at this point in the history
  • Loading branch information
djfm authored and maximebiloe committed Feb 5, 2016
1 parent fec9b40 commit 18e01c6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion diff-hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,16 @@ function getFormattedHookList($hookList, $folder)
echo "Warning, could not parse hook in:\n$hook\n\n";
continue;
}

$hookName = getHookName($line[1]);

if (!preg_match('/^\w+$/', $hookName)) {
echo "Warning, strange hook name found in {$line[0]}:\n$hookName\n\n";
continue;
}

$path = formatFilePath($line[0], $folder);
$list[getHookName($line[1])][$path] = $path;
$list[$hookName][$path] = $path;
ksort($list[getHookName($line[1])]);
}

Expand Down

0 comments on commit 18e01c6

Please sign in to comment.