#627 Exact Title Search fails with blank page


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),

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.


  • 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.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks