X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchPostgres.php;h=8ba49b60f9dcdabadcec361ddd220eb72d451693;hb=12313956c58e88b98d4baf722464e09b4a351bf3;hp=649ef4f70f65bc9f6a4fd8d75914075f9b38abcc;hpb=25d33bacb3496e9acb6ec0d7147b48a6a552c81d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 649ef4f70f..8ba49b60f9 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -76,7 +76,7 @@ class SearchPostgres extends SearchDatabase { $term = preg_replace( '/:/', ' ', $term ); $searchstring = ''; - $m = array(); + $m = []; if ( preg_match_all( '/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER ) ) { foreach ( $m as $terms ) { if ( strlen( $terms[1] ) ) { @@ -136,16 +136,15 @@ class SearchPostgres extends SearchDatabase { # # TODO: Better output (example to catch: one 'two) die( "Sorry, that was not a valid search string. Please go back and try again" ); } - $top = $res->fetchRow(); - $top = $top[0]; + $top = $res->fetchRow()[0]; - $this->searchTerms = array(); + $this->searchTerms = []; if ( $top === "" ) { # # e.g. if only stopwords are used XXX return something better $query = "SELECT page_id, page_namespace, page_title, 0 AS score " . "FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id " . "AND r.rev_text_id = c.old_id AND 1=0"; } else { - $m = array(); + $m = []; if ( preg_match_all( "/'([^']+)'/", $top, $m, PREG_SET_ORDER ) ) { foreach ( $m as $terms ) { $this->searchTerms[$terms[1]] = $terms[1];