r98754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98753‎ | r98754 | r98755 >
Date:13:10, 3 October 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Modified paths:
  • /branches/REL1_18/phase3/includes/Linker.php (modified) (history)
  • /branches/REL1_18/phase3/includes/ProtectionForm.php (modified) (history)
  • /branches/REL1_18/phase3/includes/installer/WebInstallerPage.php (modified) (history)
  • /branches/REL1_18/phase3/includes/objectcache/MemcachedClient.php (modified) (history)
  • /branches/REL1_18/phase3/includes/upload/UploadFromUrl.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/includes/upload/UploadFromUrl.php
@@ -145,7 +145,9 @@
146146 $this->mRemoveTempFile = true;
147147 $this->mFileSize = 0;
148148
149 - $req = MWHttpRequest::factory( $this->mUrl );
 149+ $req = MWHttpRequest::factory( $this->mUrl, array(
 150+ 'followRedirects' => true
 151+ ) );
150152 $req->setCallback( array( $this, 'saveTempFileChunk' ) );
151153 $status = $req->execute();
152154
Index: branches/REL1_18/phase3/includes/ProtectionForm.php
@@ -357,7 +357,7 @@
358358 $msg = wfMessage( 'restriction-' . $action );
359359 $out .= "<tr><td>".
360360 Xml::openElement( 'fieldset' ) .
361 - Xml::element( 'legend', null, $msg->exists() ? $action : $msg->text() ) .
 361+ Xml::element( 'legend', null, $msg->exists() ? $msg->text() : $action ) .
362362 Xml::openElement( 'table', array( 'id' => "mw-protect-table-$action" ) ) .
363363 "<tr><td>" . $this->buildSelector( $action, $selected ) . "</td></tr><tr><td>";
364364
@@ -569,7 +569,7 @@
570570 return wfMsg( 'protect-default' );
571571 } else {
572572 $msg = wfMessage( "protect-level-{$permission}" );
573 - if( !$msg->exists() ) {
 573+ if( $msg->exists() ) {
574574 return $msg->text();
575575 }
576576 return wfMsg( 'protect-fallback', $permission );
Index: branches/REL1_18/phase3/includes/objectcache/MemcachedClient.php
@@ -344,6 +344,16 @@
345345 return false;
346346 }
347347
 348+ public function lock( $key, $timeout = 0 ) {
 349+ /* stub */
 350+ return true;
 351+ }
 352+
 353+ public function unlock( $key ) {
 354+ /* stub */
 355+ return true;
 356+ }
 357+
348358 // }}}
349359 // {{{ disconnect_all()
350360
Index: branches/REL1_18/phase3/includes/Linker.php
@@ -1218,7 +1218,9 @@
12191219 # Media link; trail not supported.
12201220 $linkRegexp = '/\[\[(.*?)\]\]/';
12211221 $title = Title::makeTitleSafe( NS_FILE, $submatch[1] );
1222 - $thelink = self::makeMediaLinkObj( $title, $text );
 1222+ if ( $title ) {
 1223+ $thelink = self::makeMediaLinkObj( $title, $text );
 1224+ }
12231225 } else {
12241226 # Other kind of link
12251227 if ( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) {
Index: branches/REL1_18/phase3/includes/installer/WebInstallerPage.php
@@ -918,6 +918,15 @@
919919 }
920920 $caches[] = 'memcached';
921921
 922+ // We'll hide/show this on demand when the value changes, see config.js.
 923+ $cacheval = $this->getVar( 'wgMainCacheType' );
 924+ if (!$cacheval) {
 925+ // We need to set a default here; but don't hardcode it
 926+ // or we lose it every time we reload the page for validation
 927+ // or going back!
 928+ $cacheval = 'none';
 929+ }
 930+ $hidden = ($cacheval == 'memcached') ? '' : 'display: none';
922931 $this->addHTML(
923932 # Advanced settings
924933 $this->getFieldSetStart( 'config-advanced-settings' ) .
@@ -927,10 +936,10 @@
928937 'label' => 'config-cache-options',
929938 'itemLabelPrefix' => 'config-cache-',
930939 'values' => $caches,
931 - 'value' => 'none',
 940+ 'value' => $cacheval,
932941 ) ) .
933942 $this->parent->getHelpBox( 'config-cache-help' ) .
934 - '<div id="config-memcachewrapper">' .
 943+ "<div id=\"config-memcachewrapper\" style=\"$hidden\">" .
935944 $this->parent->getTextArea( array(
936945 'var' => '_MemCachedServers',
937946 'label' => 'config-memcached-servers',
@@ -1079,8 +1088,10 @@
10801089 }
10811090
10821091 foreach( $memcServers as $server ) {
1083 - $memcParts = explode( ":", $server );
1084 - if( !IP::isValid( $memcParts[0] ) ) {
 1092+ $memcParts = explode( ":", $server, 2 );
 1093+ if ( !isset( $memcParts[0] )
 1094+ || ( !IP::isValid( $memcParts[0] )
 1095+ && ( gethostbyname( $memcParts[0] ) == $memcParts[0] ) ) ) {
10851096 $this->parent->showError( 'config-memcache-badip', $memcParts[0] );
10861097 return false;
10871098 } elseif( !isset( $memcParts[1] ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r98794Merge r93431, seems missing from r98754reedy18:49, 3 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93431off-white background color matting should be applied only within the thumbnai...kaldari21:12, 28 July 2011
r94761Followup r80248; Fix inverted message exists tests in ProtectionForm.dantman14:10, 17 August 2011
r97762Added lock/unlock function stubs. Fixes:...aaron20:25, 21 September 2011
r97772* (bug 30041) Fix memcached validation in installer to accept resolvable host...brion00:11, 22 September 2011
r97774* (bug 30041) Fix installer cache selection field to keep the selected radio ...brion00:35, 22 September 2011
r97777* (bug 29154) Allow upload-by-URL to follow HTTP redirectsbrion01:15, 22 September 2011
r97817Guard against...reedy15:08, 22 September 2011

Comments

#Comment by Kaldari (talk | contribs)   18:24, 3 October 2011

This merge doesn't appear to actually incorporate r93431.

#Comment by Kaldari (talk | contribs)   19:31, 3 October 2011

fixed in r98794.

Status & tagging log