Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Archive - bug with non-numeric $page [C-Chris]
#1
MyBB 1.4.4, confirmed here too:
http://community.mybboard.net/archive/in...tpost.html

In archive mode links to threads with 0 replies and a string as param (e.g. "lastpost") produce error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-10, 10' at line 1
Query:
SELECT pid FROM posts WHERE tid='34200' AND visible='1' ORDER BY dateline LIMIT -10, 10
because of variable $page with value "lastpost".
		if($page)
		{
			$start = ($page-1) * $perpage;
		}
		else
		{
			$start = 0;
			$page = 1;
		}
A possible solution is to replace first line with:
if(is_int($page))
or maybe add $page = intval($page) ; just before using $page?
www.kozik.net.pl
- So... Maybe you shouldn't have hacked it.
- And why don't you try not breathing. Hurts, dunnit. (userfriendly.org)


Messages In This Thread
[F] Archive - bug with non-numeric $page [C-Chris] - by koziolek - 03-02-2009, 12:27 PM
RE: Archive - bug with non-numeric $page - by dvb - 03-02-2009, 02:26 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)