diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-06-29 23:09:05 -0700 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-06-29 23:09:05 -0700 |
commit | 176030f68a5cf5f6822cc11aaa3f324c29686085 (patch) | |
tree | 17e4413b231eab6806d24473c1c665e67e5b70ca /modules | |
parent | dd30ec012bddf06992988e6a931ee696e24ad8f3 (diff) |
Partial fix for ticket 471 - Fix parsing of module/theme info files in l10n scanner.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/helpers/l10n_scanner.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/gallery/helpers/l10n_scanner.php b/modules/gallery/helpers/l10n_scanner.php index a68aa28b..a8059b3a 100644 --- a/modules/gallery/helpers/l10n_scanner.php +++ b/modules/gallery/helpers/l10n_scanner.php @@ -82,11 +82,10 @@ class l10n_scanner_Core { } 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); } } } |