Skip to content

Commit

Permalink
BUGFIX Fixed 'undefined offset 10' error
Browse files Browse the repository at this point in the history
  • Loading branch information
beerbohmdo committed Feb 27, 2012
1 parent 0e2cbb0 commit 8c075da
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions i18n/i18nTextCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ protected function entitySpecFromRegexMatches($regs, $_namespace = null) {
if(strpos('$', $entity) !== FALSE) return false;

// remove wrapping quotes
$value = ($regs[2]) ? substr($regs[2],1,-1) : null;
$value = !empty($regs[2]) ? substr($regs[2],1,-1) : null;

$value = preg_replace("/([^\\])['\"][[:space:]]*\.[[:space:]]*['\"]/", '\\1', $value);
$value = preg_replace("#([^\\\\])['\"][[:space:]]*\.[[:space:]]*['\"]#", '\\1', $value);

// only escape quotes when wrapped in double quotes, to make them safe for insertion
// into single-quoted PHP code. If they're wrapped in single quotes, the string should
Expand All @@ -314,13 +314,12 @@ protected function entitySpecFromRegexMatches($regs, $_namespace = null) {
$value = str_replace("'","\\'", $value);
}


// remove starting comma and any newlines
$eol = PHP_EOL;
$prio = ($regs[10]) ? trim(preg_replace("/$eol/", '', substr($regs[10],1))) : null;
$prio = !empty($regs[10]) ? trim(preg_replace("/$eol/", '', substr($regs[10],1))) : null;

// remove wrapping quotes
$comment = ($regs[12]) ? substr($regs[12],1,-1) : null;
$comment = !empty($regs[12]) ? substr($regs[12],1,-1) : null;

return array(
"{$namespace}.{$entity}" => array(
Expand Down

0 comments on commit 8c075da

Please sign in to comment.