Index: branches/5.2.x/core/units/helpers/themes_helper.php =================================================================== diff -u -N -r15717 -r15805 --- branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 15717) +++ branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 15805) @@ -1,6 +1,6 @@
||
- ##-->*/ $comment_end = strpos($template_data, '##-->'); @@ -442,36 +441,21 @@ return Array (); } - $ret = Array (); $comment = trim( substr($template_data, 6, $comment_end - 6) ); - $allowed_settings = Array ('name', 'desc', 'section', 'section_aware'); + if (preg_match_all('/<(NAME|DESC|SECTION)>(.*?)<\/(NAME|DESC|SECTION)>/is', $comment, $regs)) { + $ret = Array (); + foreach ($regs[1] as $param_order => $param_name) { + $ret[ strtolower($param_name) ] = trim($regs[2][$param_order]); + } - $meta_info = simplexml_load_string('' . $comment . ''); - /* @var $meta_info SimpleXMLElement[] */ - - if ( $meta_info === false ) { - // Malformed XML. SimpleXML will print an error itself. - return Array (); - } - - foreach ($meta_info as $setting) { - $setting_name = strtolower($setting->getName()); - - if ( !in_array($setting_name, $allowed_settings) ) { - trigger_error('Setting "' . $setting_name . '" not supported in "' . $template_file . '" template', E_USER_WARNING); - continue; + if (array_key_exists('section', $ret) && $ret['section']) { + $category_path = explode('||', $ret['section']); + $category_path = array_map('trim', $category_path); + $ret['section'] = implode('||', $category_path); } - $ret[$setting_name] = trim($setting); + return $ret; } - - if ( array_key_exists('section', $ret) && $ret['section'] ) { - $category_path = explode('||', $ret['section']); - $category_path = array_map('trim', $category_path); - $ret['section'] = implode('||', $category_path); - } - - return $ret; } return Array ();