Skip to content
This repository was archived by the owner on Feb 8, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions core/components/stercseo/elements/plugins/stercseo.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
} elseif ($resource) {
$properties['searchable'] = $resource->get('searchable');
}

$properties['urls'] = '';
// Fetch urls from seoUrl collection
if ($urls && is_object($urls)) {
Expand Down Expand Up @@ -210,11 +210,11 @@
if (!$stercseo->isAllowed($resource->context_key)) {
return;
}

/* Tmp overwrite the cache_alias_map setting to prevent that a redirect is removed again. */
$cacheAliasMap = $modx->getOption('cache_alias_map', true);
$modx->setOption('cache_alias_map', false);

$url = urlencode($modx->makeUrl($resource->id, $resource->context_key, '', 'full'));
$urlExists = $modx->getObject('seoUrl', array(
'url' => $url,
Expand All @@ -227,7 +227,7 @@
'context_key' => $resource->context_key
));
}

$modx->setOption('cache_alias_map', $cacheAliasMap);
break;

Expand Down Expand Up @@ -262,10 +262,10 @@

$query->where(array(
array(
'url' => urlencode('http://' . $url)
'url' => urlencode(rawurldecode('http://' . $url))
),
array(
'url' => urlencode('https://' . $url)
'url' => urlencode(rawurldecode('https://' . $url))
)
),xPDOQuery::SQL_OR);

Expand Down Expand Up @@ -353,7 +353,7 @@
$stercseo->setWorkingContext($resource->get('context_key'));

$site_url = $stercseo->getOption('site_url', '', $modx->getOption('site_url'));

$childResources = $modx->getIterator('modResource', $cond);
foreach ($childResources as $childResource) {
$url = urlencode($site_url . $childResource->get('uri'));
Expand Down