mirror of
https://github.com/getgrav/grav.git
synced 2026-02-04 13:50:13 +01:00
Cleanup
This commit is contained in:
@@ -267,7 +267,8 @@ trait ParsedownGravTrait
|
||||
// if this is a link
|
||||
if (isset($excerpt['element']['attributes']['href'])) {
|
||||
$url = parse_url(htmlspecialchars_decode($excerpt['element']['attributes']['href']));
|
||||
|
||||
$actions = [];
|
||||
|
||||
// if there is a query, then parse it and build action calls
|
||||
if (isset($url['query'])) {
|
||||
$actions = array_reduce(explode('&', $url['query']), function ($carry, $item) {
|
||||
@@ -278,8 +279,6 @@ trait ParsedownGravTrait
|
||||
return $carry;
|
||||
}, []);
|
||||
|
||||
$actions['fixOrientation'] = true;
|
||||
|
||||
// valid attributes supported
|
||||
$valid_attributes = ['rel', 'target', 'id', 'class', 'classes'];
|
||||
|
||||
@@ -301,14 +300,11 @@ trait ParsedownGravTrait
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$url['query']= http_build_query($actions, null, '&', PHP_QUERY_RFC3986);
|
||||
} else {
|
||||
$actions['fixOrientation'] = true;
|
||||
$url['query']= http_build_query($actions, null, '&', PHP_QUERY_RFC3986);
|
||||
}
|
||||
|
||||
$actions['fixOrientation'] = true;
|
||||
$url['query']= http_build_query($actions, null, '&', PHP_QUERY_RFC3986);
|
||||
|
||||
// if no query elements left, unset query
|
||||
if (empty($url['query'])) {
|
||||
unset ($url['query']);
|
||||
|
||||
Reference in New Issue
Block a user