[web-doc] master: Fix diff header skip. Thanks. Closes GH-31

From: Date: Tue, 11 Jan 2022 01:50:53 +0000
Subject: [web-doc] master: Fix diff header skip. Thanks. Closes GH-31
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-2500@lists.php.net to get a copy of this message
Author: Lucas Azevedo (lhsazevedo) Committer: Nilgün Belma Bugüner (nilgun) Date: 2022-01-11T04:49:36+03:00 Commit: https://github.com/php/web-doc/commit/970adac4e9ec4d17393647ca1548d4c10287f70f Raw diff: https://github.com/php/web-doc/commit/970adac4e9ec4d17393647ca1548d4c10287f70f.diff Fix diff header skip. Thanks. Closes GH-31 Changed paths: M include/lib_revcheck.inc.php Diff: diff --git a/include/lib_revcheck.inc.php b/include/lib_revcheck.inc.php index 8457639..02f34d8 100644 --- a/include/lib_revcheck.inc.php +++ b/include/lib_revcheck.inc.php @@ -279,7 +279,10 @@ function showdiff () echo "<div style='padding: 12px;'>$gitfile</div>"; - foreach (array_slice($lines, 4) as $line) { + // Count how many lines to skip diff header + $diffStartLine = substr_count($raw, "\n", 0, strpos($raw, " @@")); + + foreach (array_slice($lines, $diffStartLine) as $line) { $fc = substr( $line , 0 , 1 ); echo "<div style='display: flex;'>";

« previous php.doc.web (#2500) next »