fixed line count bug

This commit is contained in:
gently 2021-05-02 11:05:32 +08:00
parent c2eb70bf36
commit 65a0b246c1
3 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
!Title: anti-AD
!Version: 20210502104937
!Version: 20210502110445
!Homepage: https://github.com/privacy-protection-tools/anti-AD
!Total lines: 38091
!Total lines: 38087
@@||ads.taboola.com^
@@||tracker.eu.org^
@@||stats.uptimerobot.com^

View File

@ -1 +1 @@
cd07037f1525893c9abaeee5883d4a78
221601e4c108b3b324b43aecd017dc03

View File

@ -731,7 +731,7 @@ foreach($arr_wild_src as $wild_rule => $wild_value){
}
$line_count += substr_count($src_content, "\n");
$src_content = str_replace("!Total lines: 00000\n", '!Total lines: ' . $line_count . "\n" . $attached_content, $src_content);
$src_content = str_replace("!Total lines: 00000\n", '!Total lines: ' . ($line_count - 4) . "\n" . $attached_content, $src_content);
file_put_contents($src_file, $src_content);
file_put_contents($src_file . '.md5', md5_file($src_file));