From 09e87fed729e135d50366587f0fa94dbd0155577 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 20 Mar 2004 08:55:22 +0000 Subject: [PATCH] Uninitialized variable cleanup --- includes/SpecialBooksources.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/includes/SpecialBooksources.php b/includes/SpecialBooksources.php index 32a73de42b..f527276cb1 100644 --- a/includes/SpecialBooksources.php +++ b/includes/SpecialBooksources.php @@ -3,10 +3,16 @@ # ISBNs in wiki pages will create links to this page, with # the ISBN passed in via the query string. -function wfSpecialBooksources() +function wfSpecialBooksources( $par ) { - $isbn = preg_replace( '/[^0-9X]/', '', $_REQUEST["isbn"] ); - + global $wgRequest; + + $isbn = $par; + if( empty( $par ) ) { + $isbn = $wgRequest->getVal( 'isbn' ); + } + $isbn = preg_replace( '/[^0-9X]/', '', $isbn ); + $bsl = new BookSourceList( $isbn ); $bsl->show(); } @@ -23,13 +29,13 @@ class BookSourceList { function show() { global $wgOut, $wgUser, $wgLang; - global $ip, $wpBlockAddress, $wpBlockReason; - $fname="BookSourceList::show()"; + $fname = "BookSourceList::show()"; + $noautolist = false; $wgOut->setPagetitle( wfMsg( "booksources" ) ); - $bstext=wfMsg( "booksourcetext" ); + $bstext = wfMsg( "booksourcetext" ); - if($this->mIsbn) { + if( $this->mIsbn ) { $bstitle = Title::newFromText( wfmsg( "booksources" ) ); $sql = "SELECT cur_text FROM cur " . "WHERE cur_namespace=4 and cur_title='" . @@ -38,7 +44,7 @@ class BookSourceList { if( ( $s = wfFetchObject( $res ) ) and ( $s->cur_text != "" ) ) { $bstext = $s->cur_text; $bstext = str_replace( "MAGICNUMBER", $this->mIsbn, $bstext ); - $noautolist = 1; + $noautolist = true; } } -- 2.20.1