X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/d75ce11339b35963b5f8c3d53190819c1c025716..8c41e2cbfa5bfcd79f0aec6e34220379ccc842fd:/includes/specials/SpecialFileDuplicateSearch.php diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 0ed7020a..172e92ad 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -1,24 +1,37 @@ hash = $hash; $this->filename = $filename; } @@ -72,7 +85,7 @@ function wfSpecialFileDuplicateSearch( $par = null ) { $hash = ''; $filename = isset( $par ) ? $par : $wgRequest->getText( 'filename' ); - $title = Title::newFromText( $filename ); + $title = Title::makeTitleSafe( NS_FILE, $filename ); if( $title && $title->getText() != '' ) { $dbr = wfGetDB( DB_SLAVE ); $image = $dbr->tableName( 'image' ); @@ -83,13 +96,12 @@ function wfSpecialFileDuplicateSearch( $par = null ) { if( $row !== false ) { $hash = $row[0]; } - $dbr->freeResult( $res ); } # Create the input form $wgOut->addHTML( Xml::openElement( 'form', array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript ) ) . - Xml::hidden( 'title', SpecialPage::getTitleFor( 'FileDuplicateSearch' )->getPrefixedDbKey() ) . + Html::hidden( 'title', SpecialPage::getTitleFor( 'FileDuplicateSearch' )->getPrefixedDbKey() ) . Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, wfMsg( 'fileduplicatesearch-legend' ) ) . Xml::inputLabel( wfMsg( 'fileduplicatesearch-filename' ), 'filename', 'filename', 50, $filename ) . ' ' .