Skip to content

Commit

Permalink
fix 'Undefinied offset' when parsing additional functions
Browse files Browse the repository at this point in the history
  • Loading branch information
voda committed May 19, 2011
1 parent b755837 commit eb4300d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gettext-extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,19 @@
foreach ($options['k'] as $value) {
$filter = $function = $params = null;
list ($filter, $function, $params) = explode(':', $value);
$singular = $plural = $context = null;
$params = explode(',', $params);
foreach ($params as &$param) {
$param = (int)$param;
if ($param === 0) {
$param = null;
}
}
list ($singular, $plural, $context) = $params;
$keywords[] = array(
'filter' => $filter,
'function' => $function,
'singular' => $singular,
'plural' => $plural,
'context' => $context
'singular' => isset($params[0]) ? $params[0] : null,
'plural' => isset($params[1]) ? $params[1] : null,
'context' => isset($params[2]) ? $params[2] : null
);
}
}
Expand Down

0 comments on commit eb4300d

Please sign in to comment.