mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 03:27:08 +02:00
Fixed regression (#2154)
This commit is contained in:
@@ -138,9 +138,9 @@ trait AssetUtilsTrait
|
||||
}
|
||||
|
||||
if (\in_array($key, $no_key, true)) {
|
||||
$element = htmlentities($value, ENT_QUOTES | ENT_HTML5, 'UTF-8', false);
|
||||
$element = htmlentities($value, ENT_QUOTES, 'UTF-8', false);
|
||||
} else {
|
||||
$element = $key . '="' . htmlentities($value, ENT_QUOTES | ENT_HTML5, 'UTF-8', false) . '"';
|
||||
$element = $key . '="' . htmlentities($value, ENT_QUOTES, 'UTF-8', false) . '"';
|
||||
}
|
||||
|
||||
$html .= ' ' . $element;
|
||||
|
||||
@@ -68,7 +68,7 @@ class Excerpts
|
||||
*/
|
||||
public function processLinkExcerpt(array $excerpt, string $type = 'link'): array
|
||||
{
|
||||
$url = htmlspecialchars_decode(rawurldecode($excerpt['element']['attributes']['href']), ENT_QUOTES | ENT_HTML5);
|
||||
$url = htmlspecialchars_decode(rawurldecode($excerpt['element']['attributes']['href']));
|
||||
|
||||
$url_parts = $this->parseUrl($url);
|
||||
|
||||
@@ -152,7 +152,7 @@ class Excerpts
|
||||
*/
|
||||
public function processImageExcerpt(array $excerpt): array
|
||||
{
|
||||
$url = htmlspecialchars_decode(urldecode($excerpt['element']['attributes']['src']), ENT_QUOTES | ENT_HTML5);
|
||||
$url = htmlspecialchars_decode(urldecode($excerpt['element']['attributes']['src']));
|
||||
$url_parts = $this->parseUrl($url);
|
||||
|
||||
$media = null;
|
||||
|
||||
@@ -613,7 +613,7 @@ class Page implements PageInterface
|
||||
|
||||
$summary = Utils::truncateHtml($content, $size);
|
||||
|
||||
return html_entity_decode($summary, ENT_COMPAT | ENT_HTML5, 'UTF-8');
|
||||
return html_entity_decode($summary, ENT_COMPAT | ENT_HTML401, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1713,7 +1713,7 @@ class Page implements PageInterface
|
||||
$this->metadata[$prop_key] = [
|
||||
'name' => $prop_key,
|
||||
'property' => $prop_key,
|
||||
'content' => htmlspecialchars($prop_value, ENT_QUOTES | ENT_HTML5, 'UTF-8')
|
||||
'content' => htmlspecialchars($prop_value, ENT_QUOTES, 'UTF-8')
|
||||
];
|
||||
}
|
||||
} else {
|
||||
@@ -1722,16 +1722,16 @@ class Page implements PageInterface
|
||||
if (\in_array($key, $header_tag_http_equivs, true)) {
|
||||
$this->metadata[$key] = [
|
||||
'http_equiv' => $key,
|
||||
'content' => htmlspecialchars($value, ENT_QUOTES | ENT_HTML5, 'UTF-8')
|
||||
'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')
|
||||
];
|
||||
} elseif ($key === 'charset') {
|
||||
$this->metadata[$key] = ['charset' => htmlspecialchars($value, ENT_QUOTES | ENT_HTML5, 'UTF-8')];
|
||||
$this->metadata[$key] = ['charset' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')];
|
||||
} else {
|
||||
// if it's a social metadata with separator, render as property
|
||||
$separator = strpos($key, ':');
|
||||
$hasSeparator = $separator && $separator < strlen($key) - 1;
|
||||
$entry = [
|
||||
'content' => htmlspecialchars($value, ENT_QUOTES | ENT_HTML5, 'UTF-8')
|
||||
'content' => htmlspecialchars($value, ENT_QUOTES, 'UTF-8')
|
||||
];
|
||||
|
||||
if ($hasSeparator && !Utils::startsWith($key, 'twitter')) {
|
||||
@@ -2718,7 +2718,7 @@ class Page implements PageInterface
|
||||
}
|
||||
foreach ($items as $item) {
|
||||
$item = rawurldecode($item);
|
||||
if (empty($page->taxonomy[$taxonomy]) || !\in_array(htmlspecialchars_decode($item, ENT_QUOTES | ENT_HTML5), $page->taxonomy[$taxonomy], true)
|
||||
if (empty($page->taxonomy[$taxonomy]) || !\in_array(htmlspecialchars_decode($item, ENT_QUOTES), $page->taxonomy[$taxonomy], true)
|
||||
) {
|
||||
$collection->remove($page->path());
|
||||
}
|
||||
|
||||
@@ -1055,7 +1055,7 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn
|
||||
*/
|
||||
public function jsonDecodeFilter($str, $assoc = false, $depth = 512, $options = 0)
|
||||
{
|
||||
return json_decode(html_entity_decode($str, ENT_COMPAT | ENT_HTML5, 'UTF-8'), $assoc, $depth, $options);
|
||||
return json_decode(html_entity_decode($str, ENT_COMPAT | ENT_HTML401, 'UTF-8'), $assoc, $depth, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -306,7 +306,7 @@ class Uri
|
||||
public function param($id)
|
||||
{
|
||||
if (isset($this->params[$id])) {
|
||||
return html_entity_decode(rawurldecode($this->params[$id]), ENT_COMPAT | ENT_HTML5, 'UTF-8');
|
||||
return html_entity_decode(rawurldecode($this->params[$id]), ENT_COMPAT | ENT_HTML401, 'UTF-8');
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user