Project

General

Profile

Feature #22992 » 14860_v4.diff

Version 4 of the patch - Jigal van Hemert, 2016-06-09 14:27

View differences:

t3lib/class.t3lib_pagerenderer.php (working copy)
/*****************************************************/
/**
* Adds meta data
* Adds meta tag
*
* @param string $meta meta data (complete metatag)
* @param string $name name attribute of meta tag
* @param string $content content attribute of meta tag
* @param array $additionalParameter key/value pairs of additional attributes
* @return void
*/
public function addMetaTag($meta) {
if (!in_array($meta, $this->metaTags)) {
public function addMetaTag($name, $content = '', array $additionalParameter = array()) {
$additionalAttributes = '';
// backward compatibility, check for complete meta tag
if (t3lib_div::isFirstPartOfStr($name, '<')) {
$meta = $name;
} else {
if (count($additionalParameter) > 0) {
foreach ($additionalParameter as $attributeName => $attributeValue) {
$additionalAttributes .= htmlspecialchars($attributeName) . '="' . htmlspecialchars($attributeValue) . '" ';
}
}
$meta = '<meta name="' . htmlspecialchars($name) . '" ' .
'content="' . htmlspecialchars($content) . '" ' .
$additionalAttributes . '/>';
}
if (!t3lib_div::inArray($this->metaTags, $meta)) {
$this->metaTags[] = $meta;
}
}
/**
* Adds meta tag for http-equiv
*
* @param string $httpEquiv httpEquiv attribute of meta tag
* @param string $content content attribute of meta tag
* @param array $additionalParameter key/value pairs of additional attributes
* @return void
*/
public function addMetaTagHttpEquiv($httpEquiv, $content, array $additionalParameter = array()) {
$additionalAttributes = '';
if (count($additionalParameter) > 0) {
foreach ($additionalParameter as $attributeName => $attributeValue) {
$additionalAttributes .= htmlspecialchars($attributeName) . '="' . htmlspecialchars($attributeValue) . '" ';
}
}
$meta = '<meta http-equiv="' . htmlspecialchars($httpEquiv) . '" ' .
'content="' . htmlspecialchars($content) . '" ' .
$additionalAttributes . '/>';
if (!t3lib_div::inArray($this->metaTags, $meta)) {
$this->metaTags[] = $meta;
}
}
/**
* Adds inline HTML comment
*
* @param string $comment
(3-3/4)