mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +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:
@@ -165,6 +165,8 @@ class e_url
|
||||
$get = array();
|
||||
if(!empty($query))
|
||||
{
|
||||
// issue #3171 fix double ampersand in case of wrong query definition
|
||||
$query = str_replace('&&', '&', $query);
|
||||
parse_str($query,$get);
|
||||
}
|
||||
|
||||
@@ -179,7 +181,7 @@ class e_url
|
||||
if(file_exists($file))
|
||||
{
|
||||
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);
|
||||
|
||||
$this->_include= $file;
|
||||
|
@@ -1029,20 +1029,14 @@
|
||||
{
|
||||
$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.
|
||||
$url = e107::url('forum', 'topic', $this->var) . "&p=[FROM]";
|
||||
// issue #3171 old method produced an invalid url: /forum/subforum/35/forum-topic/&p=2
|
||||
// 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";
|
||||
|
||||
//XXX FIXME - pull-down template not practical here. Can we force another?
|
||||
|
||||
// $tVars->GOTOPAGES = $tp->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