Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -486,6 +486,16 @@ |
487 | 487 | } |
488 | 488 | |
489 | 489 | /** |
| 490 | + * Returns the names of all input values excluding those in $exclude. |
| 491 | + * |
| 492 | + * @param $exclude Array |
| 493 | + * @return array |
| 494 | + */ |
| 495 | + public function getValueNames( $exclude = array() ) { |
| 496 | + return array_diff( array_keys( $this->getValues() ), $exclude ); |
| 497 | + } |
| 498 | + |
| 499 | + /** |
490 | 500 | * Get the values passed in the query string. |
491 | 501 | * No transformation is performed on the values. |
492 | 502 | * |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -80,7 +80,9 @@ |
81 | 81 | $ret = Title::newFromURL( $title ); |
82 | 82 | // check variant links so that interwiki links don't have to worry |
83 | 83 | // about the possible different language variants |
84 | | - if ( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 ){ |
| 84 | + if ( count( $wgContLang->getVariants() ) > 1 |
| 85 | + && !is_null( $ret ) && $ret->getArticleID() == 0 ) |
| 86 | + { |
85 | 87 | $wgContLang->findVariantLink( $title, $ret ); |
86 | 88 | } |
87 | 89 | } |
— | — | @@ -96,7 +98,7 @@ |
97 | 99 | } |
98 | 100 | } |
99 | 101 | |
100 | | - if( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ){ |
| 102 | + if ( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ) { |
101 | 103 | $ret = new BadTitle; |
102 | 104 | } |
103 | 105 | return $ret; |
— | — | @@ -162,7 +164,9 @@ |
163 | 165 | $url = $title->getFullURL( $query ); |
164 | 166 | } |
165 | 167 | // Check for a redirect loop |
166 | | - if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url ) && $title->isLocal() ) { |
| 168 | + if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url ) |
| 169 | + && $title->isLocal() ) |
| 170 | + { |
167 | 171 | // 301 so google et al report the target as the actual url. |
168 | 172 | $output->redirect( $url, 301 ); |
169 | 173 | } else { |
— | — | @@ -172,8 +176,9 @@ |
173 | 177 | } |
174 | 178 | // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant |
175 | 179 | } elseif ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted() |
176 | | - && ( $request->getVal( 'title' ) === null || $title->getPrefixedDBKey() != $request->getVal( 'title' ) ) |
177 | | - && !count( array_diff( array_keys( $request->getValues() ), array( 'action', 'title' ) ) ) ) |
| 180 | + && ( $request->getVal( 'title' ) === null || |
| 181 | + $title->getPrefixedDBKey() != $request->getVal( 'title' ) ) |
| 182 | + && !count( $request->getValueNames( array( 'action', 'title' ) ) ) ) |
178 | 183 | { |
179 | 184 | if ( $title->getNamespace() == NS_SPECIAL ) { |
180 | 185 | list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); |
— | — | @@ -482,10 +487,14 @@ |
483 | 488 | $section = $request->getVal( 'section' ); |
484 | 489 | $oldid = $request->getVal( 'oldid' ); |
485 | 490 | if ( !$wgUseExternalEditor || $act == 'submit' || $internal || |
486 | | - $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) { |
| 491 | + $section || $oldid || |
| 492 | + ( !$user->getOption( 'externaleditor' ) && !$external ) ) |
| 493 | + { |
487 | 494 | $editor = new EditPage( $article ); |
488 | 495 | $editor->submit(); |
489 | | - } elseif ( $wgUseExternalEditor && ( $external || $user->getOption( 'externaleditor' ) ) ) { |
| 496 | + } elseif ( $wgUseExternalEditor |
| 497 | + && ( $external || $user->getOption( 'externaleditor' ) ) ) |
| 498 | + { |
490 | 499 | $mode = $request->getVal( 'mode' ); |
491 | 500 | $extedit = new ExternalEdit( $article, $mode ); |
492 | 501 | $extedit->edit(); |
— | — | @@ -588,7 +597,8 @@ |
589 | 598 | $cache = new HTMLFileCache( $wgTitle, $action ); |
590 | 599 | if ( $cache->isFileCacheGood( /* Assume up to date */ ) ) { |
591 | 600 | /* Check incoming headers to see if client has this cached */ |
592 | | - if ( !$this->context->getOutput()->checkLastModified( $cache->fileCacheTime() ) ) { |
| 601 | + $timestamp = $cache->fileCacheTime(); |
| 602 | + if ( !$this->context->getOutput()->checkLastModified( $timestamp ) ) { |
593 | 603 | $cache->loadFromFileCache(); |
594 | 604 | } |
595 | 605 | # Do any stats increment/watchlist stuff |