Skip to content

Commit 528cc13

Browse files
committed
Merge pull request #12 from velosipedist/fix/extractor-po-parse
Fix uncatchable «undefined offset» error in Extractors\Po
2 parents 76ea2b3 + c444bb0 commit 528cc13

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Gettext/Extractors/Po.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class Po extends Extractor {
88
static public function parse ($file, Entries $entries) {
99
$lines = file($file, FILE_IGNORE_NEW_LINES);
1010

11-
$i = 2;
11+
$i = 1;
1212

13-
while (($line = trim($lines[$i++])) !== '') {
13+
while ((isset($lines[++$i]) && ($line = trim($lines[$i])) !== '')) {
1414

1515
$line = self::clean($line);
1616

@@ -126,4 +126,4 @@ static private function fixMultiLines ($line, Array $lines, &$i) {
126126
}
127127
return $line;
128128
}
129-
}
129+
}

0 commit comments

Comments
 (0)