Skip to content

Commit 9dbbcee

Browse files
author
André L F S Bacci
committed
Footer support, clean up.
1 parent d085a57 commit 9dbbcee

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

scripts/translation/lib/OutputIgnoreBuffer.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,35 @@ function print()
7575
if ( count ( $this->texts ) > 0 )
7676
$this->printCount++;
7777

78-
$head = $this->filename . ':' . $this->hash( false ) . ':';
79-
$mark = $head . $this->hash( true );
78+
// footer
79+
80+
$markhead = $this->filename . ':' . $this->hash( false ) . ':';
81+
$markfull = $markhead . $this->hash( true );
8082
$marks = OutputIgnoreArgv::cacheFile()->load( array() );
8183

8284
if ( $this->args->showIgnore )
8385
{
84-
if ( in_array( $mark , $marks ) )
86+
// --add-ignore
87+
88+
if ( in_array( $markfull , $marks ) )
8589
$this->texts = array();
8690
else
87-
$this->args->pushAddIgnore( $this , $mark );
91+
$this->args->pushAddIgnore( $this , $markfull );
92+
93+
// remove duplicates
8894

89-
// old marks
90-
while ( in_array( $mark , $marks ) )
95+
while ( in_array( $markfull , $marks ) )
9196
{
92-
$key = array_search( $mark , $marks );
97+
$key = array_search( $markfull , $marks );
9398
unset( $marks[$key] );
9499
}
100+
101+
// --del-ignore
102+
95103
foreach ( $marks as $mark )
96104
if ( $mark != null )
97-
if ( str_starts_with( $mark , $head ) )
105+
if ( str_starts_with( $mark , $markhead ) )
98106
$this->args->pushDelIgnore( $this , $mark );
99-
100107
}
101108

102109
$this->addLine( "\n" );

0 commit comments

Comments
 (0)