SimplePortal

Development => Bugs => Fixed or Bogus Bugs => Topic started by: Nick on August 26, 2010, 09:01:37 AM

Title: Small bug
Post by: Nick on August 26, 2010, 09:01:37 AM
When a user has created a "Board News" block and they have more than one page to cycle through they may find the following error (Unless it was just me?). When they click let's say page 2 to go to the next page of news the addon to the link is;

Quote
?sa=news;start=0

I found that i already had a "?" after my index.php so it created a duplicate so it was

Quote
??sa=news;start=0
and didn't work. A simple edit in /Sources/PortalBlocks.php by doing the following will fix this;

Find
Code: [Select]
$clean_url = preg_replace('~(;|\?)?sa=news;start=\d+~', '', $_SERVER['REQUEST_URL']);
$current_url = $clean_url . (strpos($clean_url, '?') !== false ? ';' : '?');

$page_index = constructPageIndex($current_url . '?sa=news', $start, $limit, $per_page);

Replace
Code: [Select]
$clean_url = preg_replace('sa=news;start=\d+~', '', $_SERVER['REQUEST_URL']);
$current_url = $clean_url . (strpos($clean_url, '?') !== false ? ';' : '?');

$page_index = constructPageIndex($current_url . 'sa=news', $start, $limit, $per_page);

Title: Re: Small bug
Post by: grafitus on August 26, 2010, 09:40:41 AM
Thanks for your interast. But I'm faster than you 8):
http://simpleportal.net/index.php?issue=374.0
Title: Re: Small bug
Post by: Nick on August 26, 2010, 09:51:55 AM
Damn :P Ok i'm still taking credit for it though :D
SimplePortal 2.3.8 © 2008-2024, SimplePortal