mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
fixes #3171 moved query param p to the options/query parameter of url()
Implemented a fiy for accidentally double ampersand in the query part of the url
This commit is contained in:
@@ -160,11 +160,13 @@ class e_url
|
|||||||
if($newLocation != $this->_request)
|
if($newLocation != $this->_request)
|
||||||
{
|
{
|
||||||
$redirect = e107::getParser()->replaceConstants($newLocation);
|
$redirect = e107::getParser()->replaceConstants($newLocation);
|
||||||
list($file,$query) = explode("?",$redirect,2);
|
list($file,$query) = explode("?", $redirect,2);
|
||||||
|
|
||||||
$get = array();
|
$get = array();
|
||||||
if(!empty($query))
|
if(!empty($query))
|
||||||
{
|
{
|
||||||
|
// issue #3171 fix double ampersand in case of wrong query definition
|
||||||
|
$query = str_replace('&&', '&', $query);
|
||||||
parse_str($query,$get);
|
parse_str($query,$get);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +181,7 @@ class e_url
|
|||||||
if(file_exists($file))
|
if(file_exists($file))
|
||||||
{
|
{
|
||||||
define('e_CURRENT_PLUGIN', $plug);
|
define('e_CURRENT_PLUGIN', $plug);
|
||||||
define('e_QUERY', $query); // do not add to e107_class.php
|
define('e_QUERY', str_replace('&&', '&', $query)); // do not add to e107_class.php
|
||||||
define('e_URL_LEGACY', $redirect);
|
define('e_URL_LEGACY', $redirect);
|
||||||
|
|
||||||
$this->_include= $file;
|
$this->_include= $file;
|
||||||
|
@@ -1029,20 +1029,14 @@
|
|||||||
{
|
{
|
||||||
$thread->page = 1;
|
$thread->page = 1;
|
||||||
}
|
}
|
||||||
// $url = rawurlencode(e107::getUrl()->create('forum/thread/view', array('name' => $thread->threadInfo['thread_name'], 'id' => $thread->threadId, 'page' => '[FROM]')));
|
|
||||||
|
|
||||||
// $url = e_REQUEST_SELF."?p=[FROM]"; // SEF URL Friendly.
|
// issue #3171 old method produced an invalid url: /forum/subforum/35/forum-topic/&p=2
|
||||||
$url = e107::url('forum', 'topic', $this->var) . "&p=[FROM]";
|
// moved additional parameter p= to the options/query array
|
||||||
|
$url = e107::url('forum', 'topic', $this->var, array('query' => array('p' => '--FROM--'))); // . "&p=[FROM]";
|
||||||
|
|
||||||
$parms = "total={$thread->pages}&type=page¤t={$thread->page}&url=" . urlencode($url) . "&caption=off&tmpl=default&navcount=4&glyphs=1";
|
$parms = "total={$thread->pages}&type=page¤t={$thread->page}&url=" . urlencode($url) . "&caption=off&tmpl=default&navcount=4&glyphs=1";
|
||||||
|
|
||||||
//XXX FIXME - pull-down template not practical here. Can we force another?
|
|
||||||
|
|
||||||
// $tVars->GOTOPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}");
|
|
||||||
return e107::getParser()->parseTemplate("{NEXTPREV={$parms}}");
|
return e107::getParser()->parseTemplate("{NEXTPREV={$parms}}");
|
||||||
/*
|
|
||||||
$parms = ($thread->pages).",1,{$thread->page},url::forum::thread::func=view&id={$thread->threadId}&page=[FROM],off";
|
|
||||||
$tVars->GOTOPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}");*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user