summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-06-29 23:09:05 -0700
committerAndy Staudacher <andy.st@gmail.com>2009-06-29 23:09:05 -0700
commit176030f68a5cf5f6822cc11aaa3f324c29686085 (patch)
tree17e4413b231eab6806d24473c1c665e67e5b70ca /modules/gallery/helpers
parentdd30ec012bddf06992988e6a931ee696e24ad8f3 (diff)
Partial fix for ticket 471 - Fix parsing of module/theme info files in l10n scanner.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/l10n_scanner.php9
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);
}
}
}