Merge branch 'develop' of github.com:getgrav/grav into 1.7

 Conflicts:
	system/src/Grav/Common/Page/Page.php
This commit is contained in:
Matias Griese
2020-02-10 17:42:21 +02:00
5 changed files with 11 additions and 11 deletions

View File

@@ -154,9 +154,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;

View File

@@ -83,7 +83,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);
@@ -167,7 +167,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;

View File

@@ -657,7 +657,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');
}
/**
@@ -1647,7 +1647,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 {
@@ -1656,16 +1656,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')) {

View File

@@ -1098,7 +1098,7 @@ class TwigExtension extends AbstractExtension implements GlobalsInterface
*/
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);
}
/**

View File

@@ -334,7 +334,7 @@ class Uri
public function param($id, $default = false)
{
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 $default;