summaryrefslogtreecommitdiffstats
path: root/system/helpers/html_helper.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-01-11 12:00:38 +0100
committerAndrey Andreev <narf@devilix.net>2016-01-11 12:00:38 +0100
commit85ce9ab3f569450396a6f0688b2f047f58527598 (patch)
treefdf242f26507bbe52db60330c322b17c02439202 /system/helpers/html_helper.php
parent82761265da6a4ccd913583239a89487c40d46329 (diff)
parent7cf4cda4d56ca8c7dc51b38442d83d3b593d96f8 (diff)
Merge branch 'develop' of github.com:sebastienadam/CodeIgniter into feature/html_meta
Diffstat (limited to 'system/helpers/html_helper.php')
-rw-r--r--system/helpers/html_helper.php13
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;