diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/html_helper.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index fdc463fca..5cc994ff1 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -359,16 +359,17 @@ if ( ! function_exists('meta')) // Turn single array into multidimensional $name = array($name); } - + $allowed_type = array('charset', 'http-equiv', 'name', 'property'); $str = ''; foreach ($name as $meta) { - $type = (isset($meta['type']) && $meta['type'] !== 'name') ? 'http-equiv' : 'name'; - $name = isset($meta['name']) ? $meta['name'] : ''; - $content = isset($meta['content']) ? $meta['content'] : ''; - $newline = isset($meta['newline']) ? $meta['newline'] : "\n"; + $meta['type'] = isset($meta['type']) ? (($meta['type'] === 'equiv') ? 'http-equiv' : $meta['type']) : ''; // backward compatibility + $type = in_array($meta['type'], $allowed_type) ? $meta['type'] : 'name'; + $name = isset($meta['name']) ? $meta['name'] : ''; + $content = isset($meta['content']) ? $meta['content'] : ''; + $newline = isset($meta['newline']) ? $meta['newline'] : "\n"; - $str .= '<meta '.$type.'="'.$name.'" content="'.$content.'" />'.$newline; + $str .= '<meta '.$type.'="'.$name.(($type === 'charset')?'':'" content="'.$content).'" />'.$newline; } return $str; |