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

1 view
Skip to first unread message

Lucas Azevedo via Nilgün Belma Bugüner

unread,
Jan 10, 2022, 8:50:59 PM1/10/22
to doc...@lists.php.net
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;'>";

--
Documentation Website Mailing List (http://doc.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply all
Reply to author
Forward
0 new messages