Project

General

Profile

Feature #22992 » 14860.diff

Administrator Admin, 2010-06-25 01:17

View differences:

t3lib/class.t3lib_pagerenderer.php (working copy)
/**
* Adds meta data
*
* @param string $meta meta data (complete metatag)
* @param string $name name attribute of meta tag
* @param string $content content attribute of meta tag
* @param string $additionalParameter key/value pairs of additional attributes
* @return void
*/
public function addMetaTag($meta) {
public function addMetaTag($name, $content = '', $additionalParameter = array()) {
$additionalParameterString = '';
//backward compatibility, check for complete meta tag
if (substr($name, 0, 1) === '<') {
$meta = $name;
} else {
$name = 'name="' . htmlspecialchars($name) . '" ';
if (count($additionalParameter) > 0) {
foreach ($additionalParameter as $key => $value) {
if ($key === 'http-equiv') {
//http-equiv replace the name attribute
$name = 'http-equiv="' . htmlspecialchars($value) . '" ';
} else {
$additionalParameterString .= htmlspecialchars($key) . '="' . htmlspecialchars($value) . '" ';
}
}
}
$meta = '<meta ' . $name .
'content="' . htmlspecialchars($content) . '" ' .
$additionalParameterString . '/>';
}
if (!in_array($meta, $this->metaTags)) {
$this->metaTags[] = $meta;
}
(1-1/4)