Menu

#627 Exact Title Search fails with blank page

closed
5
2012-10-11
2010-06-18
Anonymous
No

When the result of a title search returns exactly one page, phpwiki attempts to redirect directly to this page (TitleSearch.php, line 109):

    if ($args['auto_redirect'] && ($pagelist->getTotal() == 1)) {
        $page = $pages->next();
        return HTML($request->redirect(WikiURL($page->getName(), false, 'absurl'), false),
                    $pagelist);
    }

When trying this with php 5.3.2 (not sure if this occurs with other versions), $pages->next() doesn't return anything because it has already been enumerated within a previous addPages (line 81), and nothing is returned, so the page returned is blank.

The attached patch fixes this issue.

Discussion

  • Nobody/Anonymous

     
  • Sébastien Le Callonnec

    Apologies, I didn’t realise I wasn’t authenticated logging in when logging this issue... :-/

     
  • Reini Urban

    Reini Urban - 2010-06-19

    Thanks. Fixed with r7551.
    I had to fix more issues with redirect there also.

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.