From e730b0cb657849e22456f8bc2bdf7a19307554fa Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 21 Jul 2016 18:01:31 +0200 Subject: [PATCH] only search the license header for @copyright statements --- build/license.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/license.php b/build/license.php index 2398b02e0b74f..e0af701f4faa7 100644 --- a/build/license.php +++ b/build/license.php @@ -228,9 +228,10 @@ private function eatOldLicense($source) { private function getCopyrightNotices($path, $file) { $licenseHeaderEndsAtLine = (int)trim(shell_exec("grep -n '*/' $path | head -n 1 | cut -d ':' -f 1")); - $lineByLine = explode(PHP_EOL, $file, $licenseHeaderEndsAtLine); + $lineByLine = explode(PHP_EOL, $file, $licenseHeaderEndsAtLine + 1); $copyrightNotice = []; - foreach ($lineByLine as $line) { + $licensePart = array_slice($lineByLine, 0, 20); + foreach ($licensePart as $line) { if (strpos($line, '@copyright') !== false) { $copyrightNotice[] = $line; }