Ticket #844: 20080418namefindernosearch.diff

File 20080418namefindernosearch.diff, 660 bytes (added by Shaun McDonald, 11 years ago)

patch to give a nice error when returning results, when there is no search string

  • php/search.php

     
    4444    /* remove comments in square brackets from input - these are comments */
    4545    $find = trim(preg_replace('/\\[.*\\]/', '', $find));
    4646
     47    /* is there actually something to search on? */
     48    if ($find == '') {
     49      $oxml .= " error='there is nothing to search on'>\n</searchresults>\n";
     50      return $oxml;
     51    }
     52   
    4753    /* does it look like a postcode? */
    4854    $postcodelookup = postcodelookup::postcodelookupfactory($find);
    4955    $originalpostcode = $find;