1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-17 07:46:29 +02:00

e107::url() legacy query conflict fix. newforumposts_main BC 'scrolling' fix.

This commit is contained in:
Cameron
2017-12-12 10:58:41 -08:00
parent ca5f33655b
commit ea073afe9a
3 changed files with 30 additions and 2 deletions

View File

@@ -3452,8 +3452,28 @@ class e107
$legacyUrl = preg_replace('/&?\$[\d]/i', "", $legacyUrl); // remove any left-over $x (including prefix of '&')
// Avoid duplicate query keys. eg. URL has ?id=x and $options['query']['id'] exists.
// @see forum/e_url.php - topic/redirect and forum/view_shortcodes.php sc_post_url()
list($legacyUrl,$tmp) = explode("?",$legacyUrl);
if(!empty($tmp))
{
parse_str($tmp,$qry);
foreach($qry as $k=>$v)
{
if(!isset($options['query'][$k])) // $options['query'] overrides any in the original URL.
{
$options['query'][$k] = $v;
}
}
}
// Append the query.
if (is_array($options['query']) && !empty($options['query'])) {
if (is_array($options['query']) && !empty($options['query']))
{
$legacyUrl .= (strpos($legacyUrl, '?') !== FALSE ? '&' : '?') . self::httpBuildQuery($options['query']);
}