From: Tim Starling Date: Mon, 29 Mar 2004 14:48:07 +0000 (+0000) Subject: Removed dependence on register_globals from everything except the special pages.... X-Git-Tag: 1.3.0beta1~667 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=e9aa758d7a0f21424c126d874688d219cf639feb;p=lhc%2Fweb%2Fwiklou.git Removed dependence on register_globals from everything except the special pages. Fixed miscellaneous bugs. --- diff --git a/includes/Article.php b/includes/Article.php index a57b0407ad..3bd0b2c60c 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -64,7 +64,12 @@ class Article { # Return the text of this revision function getContent( $noredir = false ) { - global $action,$section,$count; # From query string + global $wgRequest; + + # Get variables from query string :P + $action = $wgRequest->getText( 'action', 'view' ); + $section = $wgRequest->getText( 'section' ); + $fname = "Article::getContent"; wfProfileIn( $fname ); @@ -116,8 +121,11 @@ class Article { # Load the revision (including cur_text) into this object function loadContent( $noredir = false ) { - global $wgOut, $wgMwRedir; - global $oldid, $redirect; # From query + global $wgOut, $wgMwRedir, $wgRequest; + + # Query variables :P + $oldid = $wgRequest->getVal( 'oldid' ); + $redirect = $wgRequest->getVal( 'redirect' ); if ( $this->mContentLoaded ) return; $fname = "Article::loadContent"; @@ -377,28 +385,31 @@ class Article { function view() { - global $wgUser, $wgOut, $wgLang; - global $oldid, $diff; # From query + global $wgUser, $wgOut, $wgLang, $wgRequest; global $wgLinkCache, $IP, $wgEnableParserCache; $fname = "Article::view"; wfProfileIn( $fname ); + # Get variables from query string :P + $oldid = $wgRequest->getVal( 'oldid' ); + $diff = $wgRequest->getVal( 'diff' ); + $wgOut->setArticleFlag( true ); $wgOut->setRobotpolicy( "index,follow" ); # If we got diff and oldid in the query, we want to see a # diff page instead of the article. - if ( isset( $diff ) ) { + if ( !is_null( $diff ) ) { $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); - $de = new DifferenceEngine( $oldid, $diff ); + $de = new DifferenceEngine( intval($oldid), intval($diff) ); $de->showDiffPage(); wfProfileOut( $fname ); return; } - if ( !isset( $oldid ) and $this->checkTouched() ) { + if ( !is_null( $oldid ) and $this->checkTouched() ) { if( $wgOut->checkLastModified( $this->mTouched ) ){ return; } else if ( $this->tryFileCache() ) { @@ -416,7 +427,7 @@ class Article { # We're looking at an old revision - if ( $oldid ) { + if ( !empty( $oldid ) ) { $this->setOldSubtitle(); $wgOut->setRobotpolicy( "noindex,follow" ); } @@ -736,14 +747,17 @@ class Article { return $this->protect( "" ); } + # UI entry point for page deletion function delete() { - global $wgUser, $wgOut, $wgMessageCache; - global $wpConfirm, $wpReason, $image, $oldimage; + global $wgUser, $wgOut, $wgMessageCache, $wgRequest; $fname = "Article::delete"; - + $confirm = $wgRequest->getBool( 'wpConfirm' ) && $wgRequest->isPosted(); + $reason = $wgRequest->getText( 'wpReason' ); + # This code desperately needs to be totally rewritten + # Check permissions if ( ( ! $wgUser->isSysop() ) ) { $wgOut->sysopRequired(); return; @@ -761,8 +775,8 @@ class Article { return; } - if ( @$_POST["wpConfirm"] ) { - $this->doDelete(); + if ( $confirm ) { + $this->doDelete( $reason ); return; } @@ -774,7 +788,7 @@ class Article { $etitle = wfStrencode( $title ); $sql = "SELECT old_text,old_flags FROM old WHERE old_namespace=$ns and old_title='$etitle' ORDER BY inverse_timestamp LIMIT 1"; $res = wfQuery( $sql, DB_READ, $fname ); - if( ($old=wfFetchObject($res)) && !$wpConfirm ) { + if( ($old=wfFetchObject($res)) && !$confirm ) { $skin=$wgUser->getSkin(); $wgOut->addHTML("".wfMsg("historywarning")); $wgOut->addHTML( $skin->historyLink() ."

"); @@ -802,10 +816,11 @@ class Article { # this should not happen, since it is not possible to store an empty, new # page. Let's insert a standard text in case it does, though - if($length==0 && !$wpReason) { $wpReason=wfmsg("exblank");} - + if($length == 0 && $reason === "") { + $reason = wfMsg("exblank"); + } - if($length < 500 && !$wpReason) { + if($length < 500 && $reason === "") { # comment field=255, let's grep the first 150 to have some user # space left @@ -816,22 +831,22 @@ class Article { $text=preg_replace("/\>/",">",$text); $text=preg_replace("/[\n\r]/","",$text); if(!$blanked) { - $wpReason=wfMsg("excontent"). " '".$text; + $reason=wfMsg("excontent"). " '".$text; } else { - $wpReason=wfMsg("exbeforeblank") . " '".$text; + $reason=wfMsg("exbeforeblank") . " '".$text; } - if($length>150) { $wpReason .= "..."; } # we've only pasted part of the text - $wpReason.="'"; + if($length>150) { $reason .= "..."; } # we've only pasted part of the text + $reason.="'"; } } - return $this->confirmDelete(); + return $this->confirmDelete( "", $reason ); } - function confirmDelete( $par = "" ) + # Output deletion confirmation dialog + function confirmDelete( $par, $reason ) { global $wgOut; - global $wpReason; wfDebug( "Article::confirmDelete\n" ); @@ -850,7 +865,7 @@ class Article {

{$delcom}: - +
 
@@ -862,10 +877,10 @@ class Article { $wgOut->returnToMain( false ); } - function doDelete() + # Perform a deletion and output success or failure messages + function doDelete( $reason ) { global $wgOut, $wgUser, $wgLang; - global $wpReason; $fname = "Article::doDelete"; wfDebug( "$fname\n" ); @@ -889,10 +904,12 @@ class Article { } } - # Delete the article, returns success - function doDeleteArticle() + # Back-end article deletion + # Deletes the article with database consistency, writes logs, purges caches + # Returns success + function doDeleteArticle( $reason ) { - global $wgUser, $wgLang, $wgRequest; + global $wgUser, $wgLang; global $wgUseSquid, $wgDeferredUpdateList, $wgInternalServer; $fname = "Article::doDeleteArticle"; @@ -991,8 +1008,7 @@ class Article { $log = new LogPage( wfMsg( "dellogpage" ), wfMsg( "dellogpagetext" ) ); $art = $this->mTitle->getPrefixedText(); - $wpReason = $wgRequest->getText( "wpReason" ); - $log->addEntry( wfMsg( "deletedarticle", $art ), $wpReason ); + $log->addEntry( wfMsg( "deletedarticle", $art ), $reason ); # Clear the cached article id so the interface doesn't act like we exist $this->mTitle->resetArticleID( 0 ); @@ -1189,8 +1205,9 @@ class Article { } function isFileCacheable() { - global $wgUser, $wgUseFileCache, $wgShowIPinHeader; - global $action, $oldid, $diff, $redirect, $printable; + global $wgUser, $wgUseFileCache, $wgShowIPinHeader, $wgRequest; + extract( $wgRequest->getValues( 'action', 'oldid', 'diff', 'redirect', 'printable' ) ); + return $wgUseFileCache and (!$wgShowIPinHeader) and ($this->getID() != 0) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index fc5b575437..3fb050880a 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -484,7 +484,9 @@ function wfImageArchiveDir( $fname , $subdir="archive") function wfRecordUpload( $name, $oldver, $size, $desc ) { global $wgUser, $wgLang, $wgTitle, $wgOut, $wgDeferredUpdateList; - global $wgUseCopyrightUpload , $wpUploadCopyStatus , $wpUploadSource ; + global $wgRequest, $wgUseCopyrightUpload; + + extract( $wgRequest->getValues( 'wpUploadCopyStatus', 'wpUploadSource' ) ); $fname = "wfRecordUpload"; diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 04bb98d6d0..902a0c5ade 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -116,9 +116,12 @@ class ImagePage extends Article { function delete() { - global $wgUser, $wgOut; - global $wpConfirm, $wpReason, $image, $oldimage; + global $wgUser, $wgOut, $wgRequest; + $confirm = $wgRequest->getBool( 'wpConfirm' ); + $image = $wgRequest->getVal( 'image' ); + $oldimage = $wgRequest->getVal( 'oldimage' ); + # Only sysops can delete images. Previously ordinary users could delete # old revisions, but this is no longer the case. if ( !$wgUser->isSysop() ) { @@ -132,7 +135,7 @@ class ImagePage extends Article { # Better double-check that it hasn't been deleted yet! $wgOut->setPagetitle( wfMsg( "confirmdelete" ) ); - if ( $image ) { + if ( !is_null( $image ) ) { if ( "" == trim( $image ) ) { $wgOut->fatalError( wfMsg( "cannotdelete" ) ); return; @@ -140,14 +143,14 @@ class ImagePage extends Article { } # Deleting old images doesn't require confirmation - if ( $oldimage || 1 == $wpConfirm ) { + if ( !is_null( $oldimage ) || $confirm ) { $this->doDelete(); return; } - if ( $image ) { + if ( !is_null( $image ) ) { $q = "&image={$image}"; - } else if ( $oldimage ) { + } else if ( !is_null( $oldimage ) ) { $q = "&oldimage={$oldimage}"; } return $this->confirmDelete( $q ); @@ -155,12 +158,15 @@ class ImagePage extends Article { function doDelete() { - global $wgOut, $wgUser, $wgLang; - global $image, $oldimage, $wpReason; + global $wgOut, $wgUser, $wgLang, $wgRequest; global $wgUseSquid, $wgInternalServer, $wgDeferredUpdateList; $fname = "Article::doDelete"; - if ( $image ) { + $reason = $wgRequest->getVal( 'wpReason' ); + $image = $wgRequest->getVal( 'image' ); + $oldimage = $wgRequest->getVal( 'oldimage' ); + + if ( !is_null( $image ) ) { $dest = wfImageDir( $image ); $archive = wfImageDir( $image ); if ( ! unlink( "{$dest}/{$image}" ) ) { @@ -206,10 +212,10 @@ class ImagePage extends Article { $nt = Title::newFromText( $wgLang->getNsText( Namespace::getImage() ) . ":" . $image ); $article = new Article( $nt ); - $article->doDeleteArticle(); # ignore errors + $article->doDeleteArticle( $reason ); # ignore errors $deleted = $image; - } else if ( $oldimage ) { + } else if ( !is_null( $oldimage ) ) { # Squid purging if ( $wgUseSquid ) { $urlArr = Array( @@ -224,7 +230,7 @@ class ImagePage extends Article { $deleted = $oldimage; } else { - $this->doDeleteArticle(); # ignore errors + $this->doDeleteArticle( $reason ); # ignore errors $deleted = $this->mTitle->getPrefixedText(); } $wgOut->setPagetitle( wfMsg( "actioncomplete" ) ); @@ -254,10 +260,11 @@ class ImagePage extends Article { function revert() { - global $wgOut; - global $oldimage; + global $wgOut, $wgRequest; global $wgUseSquid, $wgInternalServer, $wgDeferredUpdateList; + $oldimage = $wgRequest->getText( 'oldimage' ); + if ( strlen( $oldimage ) < 16 ) { $wgOut->unexpectedValueError( "oldimage", $oldimage ); return; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index ee10dccca6..57ee228d81 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -537,7 +537,9 @@ class OutputPage { function returnToMain( $auto = true ) { - global $wgUser, $wgOut, $returnto; + global $wgUser, $wgOut, $wgRequest; + + $returnto = $wgRequest->getText( 'returnto' ); $sk = $wgUser->getSkin(); if ( "" == $returnto ) { diff --git a/includes/Parser.php b/includes/Parser.php index 7ed044d89d..4d7c86ecaf 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -182,9 +182,9 @@ class Parser $pre_content[$marker] = "
$content
"; } } - - $state = array( $nowiki_content, $hiero_content, $math_content, $pre_content ); + # Must expand in reverse order, otherwise nested tags will be corrupted + $state = array( $pre_content, $math_content, $hiero_content, $nowiki_content ); return $text; } @@ -576,6 +576,7 @@ class Parser /* private */ function handle5Quotes( &$state, $token ) { + $s = ""; if ( $state["em"] && $state["strong"] ) { if ( $state["em"] < $state["strong"] ) { $s .= ""; @@ -1407,7 +1408,10 @@ class Parser $full = ""; $head = array(); $sublevelCount = array(); + $level = 0; + $prevlevel = 0; foreach( $matches[3] as $headline ) { + $numbering = ""; if( $level ) { $prevlevel = $level; } @@ -1425,11 +1429,11 @@ class Parser $toclevel -= $prevlevel - $level; } # count number of headlines for each level - $sublevelCount[$level]++; - + @$sublevelCount[$level]++; if( $doNumberHeadings || $doShowToc ) { + $dot = 0; for( $i = 1; $i <= $level; $i++ ) { - if( $sublevelCount[$i] ) { + if( !empty( $sublevelCount[$i] ) ) { if( $dot ) { $numbering .= "."; } @@ -1452,7 +1456,7 @@ class Parser $refer[$headlineCount] = $canonized_headline; # count how many in assoc. array so we can track dupes in anchors - $refers[$canonized_headline]++; + @$refers[$canonized_headline]++; $refcount[$headlineCount]=$refers[$canonized_headline]; # Prepend the number to the heading text @@ -1476,6 +1480,9 @@ class Parser $toc .= $sk->tocLine($anchor,$tocline,$toclevel); } if( $showEditLink ) { + if ( empty( $head[$headlineCount] ) ) { + $head[$headlineCount] = ""; + } $head[$headlineCount] .= $sk->editSectionLink($headlineCount+1); } @@ -1491,16 +1498,14 @@ class Parser } # give headline the correct tag - $head[$headlineCount] .= ""; + @$head[$headlineCount] .= ""; # Add the edit section link if( $rightClickHack ) { $head[$headlineCount] = $sk->editSectionScript($headlineCount+1,$head[$headlineCount]); } - $numbering = ""; $headlineCount++; - $dot = 0; } if( $doShowToc ) { @@ -1515,7 +1520,7 @@ class Parser $i = 0; foreach( $blocks as $block ) { - if( $showEditLink && $headlineCount > 0 && $i == 0 ) { + if( $showEditLink && $headlineCount > 0 && $i == 0 && $block != "\n" ) { # This is the [edit] link that appears for the top block of text when # section editing is enabled $full .= $sk->editSectionLink(0); diff --git a/includes/Skin.php b/includes/Skin.php index 39f86c935a..0f818a5415 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -174,21 +174,22 @@ class Skin { function getBodyOptions() { - global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $oldid, $redirect, $diff,$action; + global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $wgRequest; + + extract( $wgRequest->getValues( 'oldid', 'redirect', 'diff' ) ); if ( 0 != $wgTitle->getNamespace() ) { $a = array( "bgcolor" => "#ffffec" ); } else $a = array( "bgcolor" => "#FFFFFF" ); - if($wgOut->isArticle() && $wgUser->getOption("editondblclick") - && - (!$wgTitle->isProtected() || $wgUser->isSysop()) - - ) { + if($wgOut->isArticle() && $wgUser->getOption("editondblclick") && + (!$wgTitle->isProtected() || $wgUser->isSysop()) ) { $t = wfMsg( "editthispage" ); $oid = $red = ""; - if ( $redirect ) { $red = "&redirect={$redirect}"; } - if ( $oldid && ! isset( $diff ) ) { + if ( $redirect ) { + $red = "&redirect={$redirect}"; + } + if ( !empty($oldid) && ! isset( $diff ) ) { $oid = "&oldid={$oldid}"; } $s = $wgTitle->getFullURL( "action=edit{$oid}{$red}" ); @@ -411,7 +412,10 @@ class Skin { function pageTitleLinks() { - global $wgOut, $wgTitle, $oldid, $action, $diff, $wgUser, $wgLang, $wgUseApproval; + global $wgOut, $wgTitle, $wgUser, $wgLang, $wgUseApproval, $wgRequest; + + extract( $wgRequest->getValues( 'oldid', 'diff' ) ); + $action = $wgRequest->getText( 'action' ); $s = $this->printableLink(); if ( wfMsg ( "disclaimers" ) != "-" ) $s .= " | " . $this->makeKnownLink( wfMsg( "disclaimerpage" ), wfMsg( "disclaimers" ) ) ; @@ -584,7 +588,9 @@ class Skin { function searchForm() { - global $search; + global $wgRequest; + + $search = $wgRequest->getText( 'search' );; $s = "" @@ -658,9 +664,10 @@ class Skin { function pageStats() { - global $wgOut, $wgLang, $wgArticle; - global $oldid, $diff, $wgDisableCounters; - + global $wgOut, $wgLang, $wgArticle, $wgRequest; + global $wgDisableCounters; + + extract( $wgRequest->getValues( 'oldid', 'diff' ) ); if ( ! $wgOut->isArticle() ) { return ""; } if ( isset( $oldid ) || isset( $diff ) ) { return ""; } if ( 0 == $wgArticle->getID() ) { return ""; } @@ -700,12 +707,14 @@ class Skin { function quickBar() { - global $wgOut, $wgTitle, $wgUser, $action, $wgLang; - global $wpPreview, $wgDisableUploads, $wgRemoteUploads; + global $wgOut, $wgTitle, $wgUser, $wgRequest, $wgLang; + global $wgDisableUploads, $wgRemoteUploads; $fname = "Skin::quickBar"; wfProfileIn( $fname ); + $action = $wgRequest->getText( 'action' ); + $wpPreview = $wgRequest->getBool( 'wpPreview' ); $tns=$wgTitle->getNamespace(); $s = "\n
"; @@ -921,8 +930,12 @@ class Skin { function editThisPage() { - global $wgOut, $wgTitle, $oldid, $redirect, $diff; - + global $wgOut, $wgTitle, $wgRequest; + + $oldid = $wgRequest->getVal( 'oldid' ); + $diff = $wgRequest->getVal( 'diff' ); + $redirect = $wgRequest->getVal( 'redirect' ); + if ( ! $wgOut->isArticleRelated() ) { $s = wfMsg( "protectedpage" ); } else { @@ -935,7 +948,7 @@ class Skin { } $oid = $red = ""; - if ( $redirect ) { $red = "&redirect={$redirect}"; } + if ( !is_null( $redirect ) ) { $red = "&redirect={$redirect}"; } if ( $oldid && ! isset( $diff ) ) { $oid = "&oldid={$oldid}"; } @@ -946,8 +959,9 @@ class Skin { function deleteThisPage() { - global $wgUser, $wgOut, $wgTitle, $diff; + global $wgUser, $wgOut, $wgTitle, $wgRequest; + $diff = $wgRequest->getVal( 'diff' ); if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) { $n = $wgTitle->getPrefixedText(); $t = wfMsg( "deletethispage" ); @@ -961,8 +975,9 @@ class Skin { function protectThisPage() { - global $wgUser, $wgOut, $wgTitle, $diff; + global $wgUser, $wgOut, $wgTitle, $wgRequest; + $diff = $wgRequest->getVal( 'diff' ); if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) { $n = $wgTitle->getPrefixedText(); @@ -982,7 +997,7 @@ class Skin { function watchThisPage() { - global $wgUser, $wgOut, $wgTitle, $diff; + global $wgUser, $wgOut, $wgTitle; if ( $wgOut->isArticleRelated() ) { $n = $wgTitle->getPrefixedText(); @@ -1067,7 +1082,6 @@ class Skin { global $wgOut, $wgLang, $wgTitle, $wgUseNewInterlanguage; $a = $wgOut->getLanguageLinks(); - # TEST THIS @@@ if ( 0 == count( $a ) ) { if ( !$wgUseNewInterlanguage ) return ""; $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ; @@ -2233,11 +2247,11 @@ class Skin { } function tocIndent($level) { - return str_repeat( "
\n", $level ); + return str_repeat( "
\n", $level>0 ? $level : 0 ); } function tocUnindent($level) { - return str_repeat( "
\n", $level ); + return str_repeat( "
\n", $level>0 ? $level : 0 ); } # parameter level defines if we are on an indentation level diff --git a/includes/SkinCologneBlue.php b/includes/SkinCologneBlue.php index 46dbdebdbd..44a2d9ed95 100644 --- a/includes/SkinCologneBlue.php +++ b/includes/SkinCologneBlue.php @@ -252,7 +252,9 @@ class SkinCologneBlue extends Skin { function searchForm( $label = "" ) { - global $search; + global $wgRequest; + + $search = $wgRequest->getText( 'search' ); $s = ""; if ( "" != $label ) { $s .= "{$label}: "; } diff --git a/includes/SkinFramed.php b/includes/SkinFramed.php index cc187227d1..51bb929a37 100644 --- a/includes/SkinFramed.php +++ b/includes/SkinFramed.php @@ -5,8 +5,8 @@ class SkinFramed extends Skin { function useBodyTag() { - global $frame; - return ( "set" != $frame ); + global $wgRequest; + return ( "set" != $wgRequest->getText( 'frame' ) ); } function qbSetting() { return 0; } @@ -50,9 +50,10 @@ class SkinFramed extends Skin { function transformContent( $text ) { - global $frame, $HTTP_SERVER_VARS; + global $wgRequest, $HTTP_SERVER_VARS; global $wgOut, $wgServer, $wgScript; + $frame = $wgRequest->getText( 'frame' ); $qs = $HTTP_SERVER_VARS["QUERY_STRING"]; $qs = wfEscapeHTML( $qs ); diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 977c588642..8ada94cd53 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -39,7 +39,11 @@ function outputPage( &$out ) { global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut; global $wgScriptPath, $wgStyleSheetPath, $wgLanguageCode, $wgUseNewInterlanguage; - global $wgOutputEncoding, $wgUseDatabaseMessages, $action, $oldid, $diff; + global $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest; + + $action = $wgRequest->getText( 'action' ); + $oldid = $wgRequest->getVal( 'oldid' ); + $diff = $wgRequest->getVal( 'diff' ); $this->initPage(); $tpl = new PHPTAL($this->template . '.pt', 'templates'); diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index cecd6c5bb1..71d72fde38 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -304,7 +304,7 @@ function userNotPrivilegedMessage() if ( 0 != $wgUser->getID() ) { $name = $wgUser->getName(); } else { - $name = $_COOKIE["{$wgDBname}UserName"]; + $name = @$_COOKIE["{$wgDBname}UserName"]; } } $pwd = $wgRequest->getText( 'wpPassword' ); diff --git a/includes/Title.php b/includes/Title.php index 86a3f7d240..b5f2a6e7ba 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -235,7 +235,9 @@ class Title { # The URL contains $1, which is replaced by the title function getInterwikiLink( $key ) { - global $wgMemc, $wgDBname, $title_interwiki_cache; + global $wgMemc, $wgDBname; + static $title_interwiki_cache = array(); + $k = "$wgDBname:interwiki:$key"; if( array_key_exists( $k, $title_interwiki_cache ) ) diff --git a/includes/User.php b/includes/User.php index a6f1fb56fa..772672eccc 100644 --- a/includes/User.php +++ b/includes/User.php @@ -226,7 +226,6 @@ class User { } wfFreeResult( $res ); } else { - # TEST THIS @@@ global $wgDBname, $wgMemc; $key = "$wgDBname:newtalk:ip:{$this->mName}"; $newtalk = $wgMemc->get( $key ); diff --git a/includes/WebRequest.php b/includes/WebRequest.php index c75763e971..26410580b1 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -112,6 +112,18 @@ class WebRequest { return $this->getGPCText( $_REQUEST, $name, $default ); } + function getValues() { + $names = func_get_args(); + $retVal = array(); + foreach ( $names as $name ) { + $value = $this->getVal( $name ); + if ( !is_null( $value ) ) { + $retVal[$name] = $value; + } + } + return $retVal; + } + function wasPosted() { return $_SERVER['REQUEST_METHOD'] == 'POST'; } @@ -150,4 +162,4 @@ class WebRequest { } -?> \ No newline at end of file +?> diff --git a/languages/Language.php b/languages/Language.php index 931014702a..5b6361e6e2 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -84,7 +84,7 @@ if($wgMetaNamespace === FALSE) "contextlines" => 5, "contextchars" => 50, "skin" => 'standard', "math" => 1, "rcdays" => 7, "rclimit" => 50, "highlightbroken" => 1, "stubthreshold" => 0, - "previewontop" => 1, "editsection"=>0,"editsectiononrightclick"=>0, "showtoc"=>1, + "previewontop" => 1, "editsection"=>1,"editsectiononrightclick"=>0, "showtoc"=>1, "showtoolbar" =>1, "date" => 0 );