Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the URL parameter "limitstart=0" with "start=0" if the SEF mode is on #19452

Merged
merged 2 commits into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions libraries/src/Router/SiteRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,9 @@ protected function processParseRules(&$uri, $stage = self::PROCESS_DURING)
// Process the pagination support
if ($this->_mode == JROUTER_MODE_SEF)
{
if ($start = $uri->getVar('start'))
$start = $uri->getVar('start');

if ($start !== null)
{
$uri->delVar('start');
$vars['limitstart'] = $start;
Expand Down Expand Up @@ -678,7 +680,9 @@ protected function processBuildRules(&$uri, $stage = self::PROCESS_DURING)

if ($this->_mode == JROUTER_MODE_SEF && $route)
{
if ($limitstart = $uri->getVar('limitstart'))
$limitstart = $uri->getVar('limitstart');

if ($limitstart !== null)
{
$uri->setVar('start', (int) $limitstart);
$uri->delVar('limitstart');
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/suites/libraries/cms/router/JRouterSiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,11 @@ public function casesProcessBuildRules()
'mode' => JROUTER_MODE_SEF,
'expected' => 'test?start=42'
),
'limitstart_zero' => array(
'url' => 'test?limitstart=0',
'mode' => JROUTER_MODE_SEF,
'expected' => 'test?start=0'
),
);
}

Expand Down