r4794 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r4793‎ | r4794 | r4795 >
Date:05:02, 15 August 2004
Author:vibber
Status:old
Tags:
Comment:
One more tweak for the page subtitle. Fix for
Bug 54: go-search for non-existing page in a namespace returns broken new-edit URL
http://bugzilla.wikipedia.org/show_bug.cgi?id=54
Modified paths:
  • /branches/REL1_3/phase3/includes/SearchEngine.php (modified) (history)

Diff [purge]

Index: branches/REL1_3/phase3/includes/SearchEngine.php
@@ -2,7 +2,7 @@
33 # See search.doc
44
55 class SearchEngine {
6 - /* private */ var $mUsertext, $mSearchterms;
 6+ /* private */ var $mRawtext, $mUsertext, $mSearchterms;
77 /* private */ var $mTitlecond, $mTextcond;
88
99 var $doSearchRedirects = true;
@@ -18,6 +18,7 @@
1919 global $wgDBmysql4;
2020 $lc = SearchEngine::legalSearchChars() . "()";
2121 if( $wgDBmysql4 ) $lc .= "\"~<>*+-";
 22+ $this->mRawtext = $text;
2223 $this->mUsertext = trim( preg_replace( "/[^{$lc}]/", " ", $text ) );
2324 $this->mSearchterms = array();
2425 $this->mStrictMatching = true; # Google-style, add '+' on all terms
@@ -146,7 +147,7 @@
147148 function setupPage() {
148149 global $wgOut;
149150 $wgOut->setPageTitle( wfMsg( "searchresults" ) );
150 - $q = wfMsg( "searchquery", htmlspecialchars( $this->mUsertext ) );
 151+ $q = wfMsg( "searchquery", htmlspecialchars( $this->mRawtext ) );
151152 $wgOut->setSubtitle( $q );
152153 $wgOut->setArticleRelated( false );
153154 $wgOut->setRobotpolicy( "noindex,nofollow" );
@@ -478,7 +479,7 @@
479480 }
480481
481482 # No match, generate an edit URL
482 - $t = Title::newFromText( $wgRequest->getText( "search" ) );
 483+ $t = Title::newFromText( $this->mRawtext );
483484
484485 # If the feature is enabled, go straight to the edit page
485486 if ( $wgGoToEdit ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r4795Show the search terms as given instead of the filtered terms in the subtitle....vibber05:05, 15 August 2004

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r4792Use original instead of filtered search request for the optional new page edi...vibber04:38, 15 August 2004
r4793Use original instead of filtered search request for the optional new page edi...vibber04:42, 15 August 2004

Status & tagging log