Skip to content

Commit

Permalink
Partial fix for ticket 471 - Fix parsing of module/theme info files i…
Browse files Browse the repository at this point in the history
…n l10n scanner.
  • Loading branch information
andyst committed Jun 30, 2009
1 parent dd30ec0 commit 176030f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/gallery/helpers/l10n_scanner.php
Expand Up @@ -82,11 +82,10 @@ static function scan_php_file($file, &$cache) {
}

static function scan_info_file($file, &$cache) {
$code = file_get_contents($file);
if (preg_match("#name\s*?=\s*(.*?)\ndescription\s*?=\s*(.*)\n#", $code, $matches)) {
unset($matches[0]);
foreach ($matches as $string) {
l10n_scanner::process_message($string, $cache);
$info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
foreach (array('name', 'description') as $property) {
if (isset($info->$property)) {
l10n_scanner::process_message($info->$property, $cache);
}
}
}
Expand Down

0 comments on commit 176030f

Please sign in to comment.