mirror of
https://github.com/getgrav/grav.git
synced 2026-02-24 07:31:30 +01:00
Fixed remote URLs in markdown if using subfolder setup
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
3. [](#bugfix)
|
||||
* Fixed locking and reading files using `Framework\File` classes
|
||||
* Fixed `Utils::resolveTokenPath()` with `@variable@` not working properly
|
||||
* Fixed remote URLs in markdown if using subfolder setup
|
||||
|
||||
# v1.7.33
|
||||
## mm/dd/2022
|
||||
|
||||
@@ -97,6 +97,10 @@ class Excerpts
|
||||
{
|
||||
$grav = Grav::instance();
|
||||
$url = htmlspecialchars_decode(rawurldecode($excerpt['element']['attributes']['href']));
|
||||
if (Uri::isExternal($url) && !str_starts_with($url, $grav['base_url_absolute'])) {
|
||||
return $excerpt;
|
||||
}
|
||||
|
||||
$url_parts = $this->parseUrl($url);
|
||||
|
||||
// If there is a query, then parse it and build action calls.
|
||||
@@ -185,7 +189,12 @@ class Excerpts
|
||||
*/
|
||||
public function processImageExcerpt(array $excerpt): array
|
||||
{
|
||||
$grav = Grav::instance();
|
||||
$url = htmlspecialchars_decode(urldecode($excerpt['element']['attributes']['src']));
|
||||
if (Uri::isExternal($url) && !str_starts_with($url, $grav['base_url_absolute'])) {
|
||||
return $excerpt;
|
||||
}
|
||||
|
||||
$url_parts = $this->parseUrl($url);
|
||||
|
||||
$media = null;
|
||||
@@ -196,7 +205,6 @@ class Excerpts
|
||||
|
||||
$media = $this->page->getMedia();
|
||||
} else {
|
||||
$grav = Grav::instance();
|
||||
/** @var Pages $pages */
|
||||
$pages = $grav['pages'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user