Fixes webhook diff generator

This commit is contained in:
Jonathan (JJRcop)
2018-01-10 14:39:27 -05:00
parent 17c45467da
commit 07d1f7cf19

View File

@@ -546,7 +546,7 @@ function auto_update($payload){
$content = file_get_contents('https://raw.githubusercontent.com/' . $repoOwnerAndName . '/' . $tracked_branch . '/'. $path_to_script);
$content_diff = "### Diff not available. :slightly_frowning_face:";
if($github_diff && preg_match('/(diff --git a\/' . preg_quote($path_to_script, '/') . '.+?)(?:^diff)?/sm', $github_diff, $matches)) {
$script_diff = matches[1];
$script_diff = $matches[1];
if($script_diff) {
$content_diff = "``" . "`DIFF\n" . $script_diff ."\n``" . "`";
}