From d153f26a0e6892e19fb48488d2b96e36d1b0c0f2 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 19 May 2003 21:30:19 +0000 Subject: [PATCH] Code style tweaks, use wfStrencode just in case some language ends up using an apostrophe in the book sources title --- includes/SpecialBooksources.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/includes/SpecialBooksources.php b/includes/SpecialBooksources.php index c16b7eb8d6..bc35c85afe 100644 --- a/includes/SpecialBooksources.php +++ b/includes/SpecialBooksources.php @@ -24,34 +24,31 @@ class BookSourceList { { global $wgOut, $wgUser, $wgLang; global $ip, $wpBlockAddress, $wpBlockReason; - $fname="BookSourceList->show()"; + $fname="BookSourceList::show()"; $wgOut->setPagetitle( wfMsg( "booksources" ) ); $bstext=wfMsg( "booksourcetext" ); - if($this->mIsbn) - { - $bstitle=Title::newFromText(wfmsg("booksources")); - $sql="SELECT cur_text FROM cur WHERE cur_namespace=4 and cur_title='" . $bstitle->getPrefixedDBkey()."'"; - $res=wfQuery($sql,$fname); - if( ($s=wfFetchObject($res)) and ($s->cur_text!="")) { - - $bstext=$s->cur_text; - $bstext=str_replace("WIKI-ISBN",$this->mIsbn,$bstext); - $noautolist=1; - } - + if($this->mIsbn) { + $bstitle = Title::newFromText( wfmsg( "booksources" ) ); + $sql = "SELECT cur_text FROM cur " . + "WHERE cur_namespace=4 and cur_title='" . + wfStrencode( $bstitle->getDBkey() ) . "'"; + $res = wfQuery( $sql, $fname ); + if( ( $s = wfFetchObject( $res ) ) and ( $s->cur_text != "" ) ) { + $bstext = $s->cur_text; + $bstext = str_replace( "WIKI-ISBN", $this->mIsbn, $bstext ); + $noautolist = 1; + } } - $wgOut->addWikiText( $bstext ); - # If ISBN is blank, just show a list of links to the # home page of the various book sites. Otherwise, show # a list of links directly to the book. - if(!$noautolist) { # only do this if we haven't already shown [[Wikipedia:Book sources]] + if( !$noautolist ) { # only do this if we haven't already shown [[Wikipedia:Book sources]] $s = "\n"; $wgOut->addHTML( $s ); - } } + } } ?> -- 2.20.1