Recent Topics

?paged=x not returning a 404

Started by on Jul 10, 2010 – Contents updated: Jul 10, 2010

Jul 10, 2010 15:15    

My b2evolution Version: Not Entered

{blogurl}?paged=[insert-non-existing-page-number]

is not returning a 404 where i think it should.Instead it goes to the last page available.
Is this supposed to be 'feature' or a bug ?!
If this is considered a 'feature' i would like to change the behaviour to a 404

see for yourself

http://demo1.b2evolution.net/stable/blog1.php?paged=9821

edit: same goes for the paged posts... so i am guessing there's sth. 'wrong' with the page_links function in the core..

Jul 10, 2010 22:17

seems it's a bug..

here is an ugly fix to emulate the correct behaviour in case you need:

PHP

<?php
// Thanks to ¥åßßå  
// GOAL: return a 404 page if current page id is greater than > actual page number ( number of published posts / posts per page )
// vars included: $actual_page_numbers, $total_posts,  $posts_per_page, $current_page_id 
$current_page_id = ( empty( $_GET['paged'] ) ? '0' $_GET['paged'] );//blogurl?paged=x
$posts_per_page $Blog->get_setting'posts_per_page' );//blog post per page setting
$query "SELECT COUNT(DISTINCT post_ID) AS total_posts    FROM evo_items__item INNER JOIN evo_postcats ON post_ID = postcat_post_ID INNER JOIN evo_categories 
ON postcat_cat_ID = cat_ID WHERE cat_blog_ID = ".$Blog->ID" AND post_status = 'published' "$result mysql_query($query) or die(mysql_error());
while($row mysql_fetch_array($result)){;}
$totalposts=mysql_result($result,$row,"total_posts");
$actual_page_numbers ceil($totalposts $posts_per_page); //number of published posts / posts per page
if ( $current_page_id $actual_page_numbers)//page id is greater than actual page count so return a 404 response
header("HTTP/1.0 404 Not Found");?>

Jul 18, 2010 11:41

Moved to bugs.Not a popular one, obviously.Noone cared to respond, however afai believe it's kind of an important bug, not in terms of security but functionality.
I assume this persists in CVS release.. so should we move it t o cvs thread or leave it here under 3.3..

Jul 18, 2010 19:39

so should we move it t o cvs thread or leave it here under 3.3

It won't make any difference ;)

Aug 18, 2010 00:38

sam2kb wrote:

so should we move it t o cvs thread or leave it here under 3.3

It won't make any difference ;)

so i take it as there are no intentions to fix this ?

Dec 06, 2010 03:39

well the issue still persists in 4.0.1 (:


Form is loading...

Online manual generator – This forum is powered by b2evolution CMS, a complete engine for your website.