[MediaWiki-commits] [Gerrit] Fix incorrect replacement inside regular expression - change (mediawiki/core)

2014-10-20 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/167537

Change subject: Fix incorrect replacement inside regular expression
..

Fix incorrect replacement inside regular expression

Fix for Id3aa87cfa0 (2537ca2).

The $ is for the end of the string, not for a variable.

Change-Id: I2d262582644b903992dc621079ea5a6a04d7af70
---
M maintenance/eval.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/167537/1

diff --git a/maintenance/eval.php b/maintenance/eval.php
index ac4cb1a..25ecc09 100644
--- a/maintenance/eval.php
+++ b/maintenance/eval.php
@@ -65,7 +65,7 @@
 
 $__e = null; // PHP exception
 while ( ( $__line = Maintenance::readconsole() ) !== false ) {
-   if ( $__e  !preg_match( '/^(exit|die);?$__/', $__line ) ) {
+   if ( $__e  !preg_match( '/^(exit|die);?$/', $__line ) ) {
// Internal state may be corrupted or fatals may occur later due
// to some object not being set. Don't drop out of eval in case
// lines were being pasted in (which would then get dumped to 
the shell).

-- 
To view, visit https://gerrit.wikimedia.org/r/167537
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d262582644b903992dc621079ea5a6a04d7af70
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Get the value of microtime() directly as float in updateSpec... - change (mediawiki/core)

2014-10-20 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/167621

Change subject: Get the value of microtime() directly as float in 
updateSpecialPages.php
..

Get the value of microtime() directly as float in updateSpecialPages.php

It has a first parameter to directly get the value as float, so use it
instead of doing string manipulation.

Change-Id: Id2dff4486ea4f308ce03fc3d5546660c4e3c26b6
---
M maintenance/updateSpecialPages.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/21/167621/1

diff --git a/maintenance/updateSpecialPages.php 
b/maintenance/updateSpecialPages.php
index 6164282..d67ef6b 100644
--- a/maintenance/updateSpecialPages.php
+++ b/maintenance/updateSpecialPages.php
@@ -81,16 +81,16 @@
if ( !$this-hasOption( 'only' ) || $this-getOption( 
'only' ) == $queryPage-getName() ) {
$this-output( sprintf( '%-30s [QueryPage] ', 
$special ) );
if ( $queryPage-isExpensive() ) {
-   $t1 = explode( ' ', microtime() );
+   $t1 = microtime( true );
# Do the query
$num = $queryPage-recache( $limit === 
null ? $wgQueryCacheLimit : $limit );
-   $t2 = explode( ' ', microtime() );
+   $t2 = microtime( true );
if ( $num === false ) {
$this-output( FAILED: 
database error\n );
} else {
$this-output( got $num rows 
in  );
 
-   $elapsed = ( $t2[0] - $t1[0] ) 
+ ( $t2[1] - $t1[1] );
+   $elapsed = $t2 - $t1;
$hours = intval( $elapsed / 
3600 );
$minutes = intval( $elapsed % 
3600 / 60 );
$seconds = $elapsed - $hours * 
3600 - $minutes * 60;
@@ -139,12 +139,12 @@
continue;
}
$this-output( sprintf( '%-30s [callback] ', 
$special ) );
-   $t1 = explode( ' ', microtime() );
+   $t1 = microtime( true );
call_user_func( $call, $dbw );
-   $t2 = explode( ' ', microtime() );
+   $t2 = microtime( true );
 
$this-output( completed in  );
-   $elapsed = ( $t2[0] - $t1[0] ) + ( $t2[1] - 
$t1[1] );
+   $elapsed = $t2 - $t1;
$hours = intval( $elapsed / 3600 );
$minutes = intval( $elapsed % 3600 / 60 );
$seconds = $elapsed - $hours * 3600 - $minutes 
* 60;

-- 
To view, visit https://gerrit.wikimedia.org/r/167621
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2dff4486ea4f308ce03fc3d5546660c4e3c26b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use $_SERVER[REQUEST_TIME_FLOAT] for $wgRequestTime if ava... - change (mediawiki/core)

2014-10-20 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/167630

Change subject: Use $_SERVER[REQUEST_TIME_FLOAT] for $wgRequestTime if 
available
..

Use $_SERVER[REQUEST_TIME_FLOAT] for $wgRequestTime if available

Since PHP 5.4, a new item in  $_SERVER that gets the epoch of the
request's begin, so use it if available instead of calling ourself
microtime( true ). The latter is still kept for PHP 5.3.

Change-Id: Id430578b30a49dd560eb27e8582279a2a9dc8629
---
M includes/WebStart.php
M maintenance/Maintenance.php
2 files changed, 13 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/167630/1

diff --git a/includes/WebStart.php b/includes/WebStart.php
index cb35ee5..85fb55f 100644
--- a/includes/WebStart.php
+++ b/includes/WebStart.php
@@ -39,7 +39,13 @@
 # points and when $wgOut gets disabled or overridden.
 header( 'X-Content-Type-Options: nosniff' );
 
-$wgRequestTime = microtime( true );
+# $_SERVER[REQUEST_TIME_FLOAT] is available since PHP 5.4
+if ( isset( $_SERVER[REQUEST_TIME_FLOAT] ) ) {
+   $wgRequestTime = $_SERVER[REQUEST_TIME_FLOAT];
+} else {
+   $wgRequestTime = microtime( true );
+}
+
 unset( $IP );
 
 # Valid web server entry point, enable includes.
diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index 8d30df4..9c74e3c 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -554,8 +554,12 @@
# But sometimes this doesn't seem to be the case.
ini_set( 'max_execution_time', 0 );
 
-   $wgRequestTime = microtime( true );
-
+   # $_SERVER[REQUEST_TIME_FLOAT] is available since PHP 5.4
+   if ( isset( $_SERVER[REQUEST_TIME_FLOAT] ) ) {
+   $wgRequestTime = $_SERVER[REQUEST_TIME_FLOAT];
+   } else {
+   $wgRequestTime = microtime( true );
+   }
# Define us as being in MediaWiki
define( 'MEDIAWIKI', true );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/167630
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id430578b30a49dd560eb27e8582279a2a9dc8629
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add returntoquery URL parameter support in Special:ChangeE... - change (mediawiki/core)

2014-09-29 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/163552

Change subject: Add returntoquery URL parameter support in Special:ChangeEmail
..

Add returntoquery URL parameter support in Special:ChangeEmail

For consistency with other special pages, e.g. Special:ChangePassword.

Change-Id: I97eac516c8a366624413bfcd0f4bd9f1185b6419
---
M includes/specials/SpecialChangeEmail.php
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/163552/1

diff --git a/includes/specials/SpecialChangeEmail.php 
b/includes/specials/SpecialChangeEmail.php
index f5df54e..12bbd2a 100644
--- a/includes/specials/SpecialChangeEmail.php
+++ b/includes/specials/SpecialChangeEmail.php
@@ -112,7 +112,7 @@
$form-setTableId( 'mw-changeemail-table' );
$form-setWrapperLegend( false );
$form-setSubmitTextMsg( 'changeemail-submit' );
-   $form-addHiddenField( 'returnto', $this-getRequest()-getVal( 
'returnto' ) );
+   $form-addHiddenFields( $this-getRequest()-getValues( 
'returnto', 'returntoquery' ) );
}
 
public function onSubmit( array $data ) {
@@ -125,18 +125,21 @@
}
 
public function onSuccess() {
-   $titleObj = Title::newFromText( $this-getRequest()-getVal( 
'returnto' ) );
+   $request = $this-getRequest();
+
+   $titleObj = Title::newFromText( $request-getVal( 'returnto' ) 
);
if ( !$titleObj instanceof Title ) {
$titleObj = Title::newMainPage();
}
+   $query = $request-getVal( 'returntoquery' );
 
if ( $this-status-value === true ) {
-   $this-getOutput()-redirect( $titleObj-getFullURL() );
+   $this-getOutput()-redirect( $titleObj-getFullURL( 
$query ) );
} elseif ( $this-status-value === 'eauth' ) {
# Notify user that a confirmation email has been sent...
$this-getOutput()-wrapWikiMsg( div class='error' 
style='clear: both;'\n$1\n/div,
'eauthentsent', $this-getUser()-getName() );
-   $this-getOutput()-addReturnTo( $titleObj ); // just 
show the link to go back
+   $this-getOutput()-addReturnTo( $titleObj, 
wfCgiToArray( $query ) ); // just show the link to go back
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/163552
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I97eac516c8a366624413bfcd0f4bd9f1185b6419
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove executable bit from non-executable files - change (mediawiki/core)

2014-09-27 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/163377

Change subject: Remove executable bit from non-executable files
..

Remove executable bit from non-executable files

Change-Id: I6def7588b970a15c4e6bd49dc4f7a7138687a99e
---
M resources/src/mediawiki.skinning/content.externallinks.css
M tests/browser/Gemfile
2 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/77/163377/1

diff --git a/resources/src/mediawiki.skinning/content.externallinks.css 
b/resources/src/mediawiki.skinning/content.externallinks.css
old mode 100755
new mode 100644
diff --git a/tests/browser/Gemfile b/tests/browser/Gemfile
old mode 100755
new mode 100644

-- 
To view, visit https://gerrit.wikimedia.org/r/163377
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6def7588b970a15c4e6bd49dc4f7a7138687a99e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove dead code after removal of cancel button on Special:C... - change (mediawiki/core)

2014-09-27 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/163447

Change subject: Remove dead code after removal of cancel button on 
Special:ChangeEmail
..

Remove dead code after removal of cancel button on Special:ChangeEmail

Since the removal of the cancel button, the wpCancel parameter
cannot be present anymore, thus this check is now unneccessary.

Change-Id: Id72b29484554989ce8a639f2e0d3ecc07622edad
---
M includes/specials/SpecialChangeEmail.php
1 file changed, 2 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/163447/1

diff --git a/includes/specials/SpecialChangeEmail.php 
b/includes/specials/SpecialChangeEmail.php
index e0be838..f5df54e 100644
--- a/includes/specials/SpecialChangeEmail.php
+++ b/includes/specials/SpecialChangeEmail.php
@@ -116,12 +116,8 @@
}
 
public function onSubmit( array $data ) {
-   if ( $this-getRequest()-getBool( 'wpCancel' ) ) {
-   $status = Status::newGood( true );
-   } else {
-   $password = isset( $data['Password'] ) ? 
$data['Password'] : null;
-   $status = $this-attemptChange( $this-getUser(), 
$password, $data['NewEmail'] );
-   }
+   $password = isset( $data['Password'] ) ? $data['Password'] : 
null;
+   $status = $this-attemptChange( $this-getUser(), $password, 
$data['NewEmail'] );
 
$this-status = $status;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/163447
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id72b29484554989ce8a639f2e0d3ecc07622edad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove executable bit from non-executable files - change (mediawiki/core)

2014-09-26 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/163109

Change subject: Remove executable bit from non-executable files
..

Remove executable bit from non-executable files

Follow-up:
- Ibd1c0617c4 (d30edce)
- I1a906f533f (42583e9)

Change-Id: I8081ed2f3fbb08f1d2c0c839a697029234e4d12d
---
M resources/src/mediawiki.action/mediawiki.action.edit.styles.css
M resources/src/mediawiki.action/mediawiki.action.history.diff.css
M resources/src/mediawiki.skinning/interface.css
3 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/163109/1

diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.styles.css 
b/resources/src/mediawiki.action/mediawiki.action.edit.styles.css
old mode 100755
new mode 100644
diff --git a/resources/src/mediawiki.action/mediawiki.action.history.diff.css 
b/resources/src/mediawiki.action/mediawiki.action.history.diff.css
old mode 100755
new mode 100644
diff --git a/resources/src/mediawiki.skinning/interface.css 
b/resources/src/mediawiki.skinning/interface.css
old mode 100755
new mode 100644

-- 
To view, visit https://gerrit.wikimedia.org/r/163109
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8081ed2f3fbb08f1d2c0c839a697029234e4d12d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add missing space to log message - change (mediawiki/core)

2014-09-23 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/162216

Change subject: Add missing space to log message
..

Add missing space to log message

Follow-up I72c5c3fb75 (6fc2e603).

Change-Id: I9375da8542b3c2fb33cf0b692ab38722445081bc
---
M includes/context/RequestContext.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/162216/1

diff --git a/includes/context/RequestContext.php 
b/includes/context/RequestContext.php
index db57371..952af8c 100644
--- a/includes/context/RequestContext.php
+++ b/includes/context/RequestContext.php
@@ -140,7 +140,7 @@
if ( $this-title === null ) {
global $wgTitle; # fallback to $wg till we can improve 
this
$this-title = $wgTitle;
-   wfDebugLog( 'GlobalTitleFail', __METHOD__ . ' called by 
' . wfGetCaller() . 'with no title set.' );
+   wfDebugLog( 'GlobalTitleFail', __METHOD__ . ' called by 
' . wfGetCaller() . ' with no title set.' );
}
 
return $this-title;

-- 
To view, visit https://gerrit.wikimedia.org/r/162216
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9375da8542b3c2fb33cf0b692ab38722445081bc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Coding standard fixes in SpecialChangeEmail.php - change (mediawiki/core)

2014-09-17 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/160919

Change subject: Coding standard fixes in SpecialChangeEmail.php
..

Coding standard fixes in SpecialChangeEmail.php

Follow-up Ic5246ea0eb (74f52eb).

Change-Id: I3db34cc576b742107506d6febf603e011d24a168
---
M includes/specials/SpecialChangeEmail.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/160919/1

diff --git a/includes/specials/SpecialChangeEmail.php 
b/includes/specials/SpecialChangeEmail.php
index a3b02f5..a8dad16 100644
--- a/includes/specials/SpecialChangeEmail.php
+++ b/includes/specials/SpecialChangeEmail.php
@@ -112,8 +112,7 @@
$form-setWrapperLegendMsg( 'changeemail-header' );
$form-setSubmitTextMsg( 'changeemail-submit' );
$form-addButton( 'wpCancel', $this-msg( 'changeemail-cancel' 
)-text(),
-   null, array( 'formnovalidate')
-   );
+   null, array( 'formnovalidate' ) );
$form-addHiddenField( 'returnto', $this-getRequest()-getVal( 
'returnto' ) );
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/160919
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3db34cc576b742107506d6febf603e011d24a168
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Avoid a fatal error in maintenance/cleanupTitles.php - change (mediawiki/core)

2014-09-08 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/159116

Change subject: Avoid a fatal error in maintenance/cleanupTitles.php
..

Avoid a fatal error in maintenance/cleanupTitles.php

Title::makeTitleSafe() can return null; so only call
exists() if an object was returned, and otherwise behave
the same way as if the page existed: use another name.

Change-Id: I75ea5c5b25fa5fdf6646a177a5fbccc0dbff9b47
---
M maintenance/cleanupTitles.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/159116/1

diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php
index eee1204..0df9e7f 100644
--- a/maintenance/cleanupTitles.php
+++ b/maintenance/cleanupTitles.php
@@ -156,7 +156,7 @@
 
$clean = 'Broken/' . $prior;
$verified = Title::makeTitleSafe( $ns, $clean );
-   if ( $verified-exists() ) {
+   if ( !$verified || $verified-exists() ) {
$blah = Broken/id: . $row-page_id;
$this-output( Couldn't legalize; form 
'$clean' exists; using '$blah'\n );
$verified = Title::makeTitleSafe( $ns, $blah );

-- 
To view, visit https://gerrit.wikimedia.org/r/159116
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75ea5c5b25fa5fdf6646a177a5fbccc0dbff9b47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Replace $wgConf-localVHosts by $wgLocalVirtualHosts - change (mediawiki/core)

2014-09-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/157712

Change subject: Replace $wgConf-localVHosts by $wgLocalVirtualHosts
..

Replace $wgConf-localVHosts by $wgLocalVirtualHosts

The former is independent of the remaining of the SiteConfiguration
class, and as thus makes more sense to be defined as an explicit
configuration setting rather that being hidden in $wgConf.

Change-Id: I25204d37c5cfffb6953fe53e14316dc3df5b5b10
---
M RELEASE-NOTES-1.24
M includes/DefaultSettings.php
M includes/HttpFunctions.php
M includes/SiteConfiguration.php
4 files changed, 21 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/12/157712/1

diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24
index c5b6cd4..b4ae7f3 100644
--- a/RELEASE-NOTES-1.24
+++ b/RELEASE-NOTES-1.24
@@ -68,6 +68,7 @@
 * $wgCanonicalLanguageLinks has been removed. Per Google recommendations, we
   will not send a rel=canonical pointing to a variant-neutral page, however
   we will send rel=alternate.
+* $wgLocalVirtualHosts has been added to replace $wgConf-localVHosts.
 
 === New features in 1.24 ===
 * Added a new hook, WhatLinksHereProps, to allow extensions to annotate
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 5fc7377..3327caa 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -7027,6 +7027,17 @@
 $wgHTTPProxy = false;
 
 /**
+ * Local virtual hosts.
+ *
+ * This lists domains that are configured as virtual hosts on the same machibe.
+ * If a request is to be made to a domain listed here, or any subdomain 
thereof,
+ * then no proxy will be used.
+ * Command-line scripts are not affected by this setting and will always use
+ * proxy if it is configured.
+ */
+$wgLocalVirtualHosts = array();
+
+/**
  * Timeout for connections done internally (in seconds)
  * Only works for curl
  */
diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php
index 1eb8ca5..50e20b8 100644
--- a/includes/HttpFunctions.php
+++ b/includes/HttpFunctions.php
@@ -114,7 +114,7 @@
 * @return bool
 */
public static function isLocalURL( $url ) {
-   global $wgCommandLineMode, $wgConf;
+   global $wgCommandLineMode, $wgLocalVirtualHosts, $wgConf;
 
if ( $wgCommandLineMode ) {
return false;
@@ -126,7 +126,7 @@
$host = $matches[1];
// Split up dotwise
$domainParts = explode( '.', $host );
-   // Check if this domain or any superdomain is listed in 
$wgConf as a local virtual host
+   // Check if this domain or any superdomain is listed as 
a local virtual host
$domainParts = array_reverse( $domainParts );
 
$domain = '';
@@ -139,7 +139,9 @@
$domain = $domainPart . '.' . $domain;
}
 
-   if ( $wgConf-isLocalVHost( $domain ) ) {
+   if ( in_array( $domain, $wgLocalVirtualHosts )
+   || $wgConf-isLocalVHost( $domain )
+   ) {
return true;
}
}
diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php
index b877544..177c560 100644
--- a/includes/SiteConfiguration.php
+++ b/includes/SiteConfiguration.php
@@ -133,6 +133,8 @@
 
/**
 * Array of domains that are local and can be handled by the same server
+*
+* @deprecated since 1.24; use $wgLocalVirtualHosts instead.
 */
public $localVHosts = array();
 
@@ -565,6 +567,8 @@
 
/**
 * Returns true if the given vhost is handled locally.
+*
+* @deprecated since 1.24; check if the host is in $wgLocalVirtualHosts 
instead.
 * @param string $vhost
 * @return bool
 */

-- 
To view, visit https://gerrit.wikimedia.org/r/157712
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25204d37c5cfffb6953fe53e14316dc3df5b5b10
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove the sub page when using the form in Special:ListFiles - change (mediawiki/core)

2014-08-27 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/156684

Change subject: Remove the sub page when using the form in Special:ListFiles
..

Remove the sub page when using the form in Special:ListFiles

Follow-up Ie0a2819fdf (c01c4f0) to make I431be530ad (e1284b2)
work again.

Change-Id: Ib81c99940693fd26004682f1f61c8c7e7c42d437
---
M includes/specials/SpecialListfiles.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/156684/1

diff --git a/includes/specials/SpecialListfiles.php 
b/includes/specials/SpecialListfiles.php
index cea6ff8..1a250f1 100644
--- a/includes/specials/SpecialListfiles.php
+++ b/includes/specials/SpecialListfiles.php
@@ -548,6 +548,7 @@
$form = new HTMLForm( $fields, $this-getContext() );
 
$form-setMethod( 'get' );
+   $form-setTitle( $this-getTitle() );
$form-setId( 'mw-listfiles-form' );
$form-setWrapperLegendMsg( 'listfiles' );
$form-setSubmitTextMsg( 'table_pager_limit_submit' );

-- 
To view, visit https://gerrit.wikimedia.org/r/156684
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib81c99940693fd26004682f1f61c8c7e7c42d437
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use as strict comparison to check whether an user name was p... - change (mediawiki/core)

2014-08-27 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/156688

Change subject: Use as strict comparison to check whether an user name was 
provided in Special:ListFiles
..

Use as strict comparison to check whether an user name was provided in 
Special:ListFiles

Otherwise Special:ListFiles/0 will not behave as expected.

Change-Id: I1fa503b4b514a471ded798b54e867435d30b80c5
---
M includes/specials/SpecialListfiles.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/156688/1

diff --git a/includes/specials/SpecialListfiles.php 
b/includes/specials/SpecialListfiles.php
index cea6ff8..bd26807 100644
--- a/includes/specials/SpecialListfiles.php
+++ b/includes/specials/SpecialListfiles.php
@@ -89,7 +89,7 @@
$this-mIncluding = $including;
$this-mShowAll = $showAll;
 
-   if ( $userName ) {
+   if ( $userName !== null  $userName !== '' ) {
$nt = Title::newFromText( $userName, NS_USER );
if ( !is_null( $nt ) ) {
$this-mUserName = $nt-getText();

-- 
To view, visit https://gerrit.wikimedia.org/r/156688
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1fa503b4b514a471ded798b54e867435d30b80c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use Config instead of globals in CategoryViewer.php - change (mediawiki/core)

2014-08-26 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/156456

Change subject: Use Config instead of globals in CategoryViewer.php
..

Use Config instead of globals in CategoryViewer.php

Change-Id: If33619694f1cf298b356a1761e454e274fe6aa5c
---
M includes/CategoryViewer.php
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/156456/1

diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index ec8efae..60694c9 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -87,12 +87,11 @@
function __construct( $title, IContextSource $context, $from = array(),
$until = array(), $query = array()
) {
-   global $wgCategoryPagingLimit;
$this-title = $title;
$this-setContext( $context );
$this-from = $from;
$this-until = $until;
-   $this-limit = $wgCategoryPagingLimit;
+   $this-limit = $context-getConfig()-get( 
'CategoryPagingLimit' );
$this-cat = Category::newFromTitle( $title );
$this-query = $query;
$this-collation = Collation::singleton();
@@ -105,10 +104,10 @@
 * @return string HTML output
 */
public function getHTML() {
-   global $wgCategoryMagicGallery;
wfProfileIn( __METHOD__ );
 
-   $this-showGallery = $wgCategoryMagicGallery  
!$this-getOutput()-mNoGallery;
+   $this-showGallery = $this-getConfig()-get( 
'CategoryMagicGallery' )
+!$this-getOutput()-mNoGallery;
 
$this-clearCategoryState();
$this-doCategoryQuery();

-- 
To view, visit https://gerrit.wikimedia.org/r/156456
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If33619694f1cf298b356a1761e454e274fe6aa5c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use local content to get configuration settings in Action - change (mediawiki/core)

2014-08-16 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/154429

Change subject: Use local content to get configuration settings in Action
..

Use local content to get configuration settings in Action

Follow-up I47db5eab45 (b061c27)

Change-Id: I76409f5fc61e5d35235f964e094dd8881bcc8311
---
M includes/actions/DeleteAction.php
M includes/actions/EditAction.php
M includes/actions/ProtectAction.php
3 files changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/154429/1

diff --git a/includes/actions/DeleteAction.php 
b/includes/actions/DeleteAction.php
index 9dc1049..12f0dff 100644
--- a/includes/actions/DeleteAction.php
+++ b/includes/actions/DeleteAction.php
@@ -41,8 +41,7 @@
}
 
public function show() {
-   global $wgUseMediaWikiUIEverywhere;
-   if ( $wgUseMediaWikiUIEverywhere ) {
+   if ( $this-getContext()-getConfig()-get( 
'UseMediaWikiUIEverywhere' ) ) {
$out = $this-getOutput();
$out-addModuleStyles( array(
'mediawiki.ui.input',
diff --git a/includes/actions/EditAction.php b/includes/actions/EditAction.php
index aaf4526..8876724 100644
--- a/includes/actions/EditAction.php
+++ b/includes/actions/EditAction.php
@@ -41,8 +41,7 @@
}
 
public function show() {
-   global $wgUseMediaWikiUIEverywhere;
-   if ( $wgUseMediaWikiUIEverywhere ) {
+   if ( $this-getContext()-getConfig()-get( 
'UseMediaWikiUIEverywhere' ) ) {
$out = $this-getOutput();
$out-addModuleStyles( array(
'mediawiki.ui.input',
diff --git a/includes/actions/ProtectAction.php 
b/includes/actions/ProtectAction.php
index 443660b..a7f1ac3 100644
--- a/includes/actions/ProtectAction.php
+++ b/includes/actions/ProtectAction.php
@@ -41,8 +41,7 @@
}
 
public function show() {
-   global $wgUseMediaWikiUIEverywhere;
-   if ( $wgUseMediaWikiUIEverywhere ) {
+   if ( $this-getContext()-getConfig()-get( 
'UseMediaWikiUIEverywhere' ) ) {
$out = $this-getOutput();
$out-addModuleStyles( array(
'mediawiki.ui.input',

-- 
To view, visit https://gerrit.wikimedia.org/r/154429
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76409f5fc61e5d35235f964e094dd8881bcc8311
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove useless $out parameter from SkinTemplate::prepareQuic... - change (mediawiki/core)

2014-08-12 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/153636

Change subject: Remove useless $out parameter from 
SkinTemplate::prepareQuickTemplate()
..

Remove useless $out parameter from SkinTemplate::prepareQuickTemplate()

Part II; follow-up I4fac5b14af (ff4da35).

It makes sufficient time the first part was merged, no need to pass the
parameter anymore.

Change-Id: Icb390995912b4860df4ce2571105d3a9dc97a092
---
M includes/skins/SkinTemplate.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/153636/1

diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index 867d8ec..d08da1b 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -271,7 +271,7 @@
wfProfileIn( __METHOD__ . '-init' );
$this-initPage( $out );
wfProfileOut( __METHOD__ . '-init' );
-   $tpl = $this-prepareQuickTemplate( $out );
+   $tpl = $this-prepareQuickTemplate();
// execute template
wfProfileIn( __METHOD__ . '-execute' );
$res = $tpl-execute();

-- 
To view, visit https://gerrit.wikimedia.org/r/153636
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb390995912b4860df4ce2571105d3a9dc97a092
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix undefined variable notice in ResourceLoaderFileModule::g... - change (mediawiki/core)

2014-08-12 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/153638

Change subject: Fix undefined variable notice in 
ResourceLoaderFileModule::getSkipFunction()
..

Fix undefined variable notice in ResourceLoaderFileModule::getSkipFunction()

Looking at the call chain of validateScriptFile() up to JSTokenzier, the first
parameter if the file name, otherwise [inline] is used; so that variable
should be $localPath.

Bug: 69214
Change-Id: If7f36449cb352f50ba795a6d306e5d949a3dbd29
---
M includes/resourceloader/ResourceLoaderFileModule.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/153638/1

diff --git a/includes/resourceloader/ResourceLoaderFileModule.php 
b/includes/resourceloader/ResourceLoaderFileModule.php
index f646ae9..06f7146 100644
--- a/includes/resourceloader/ResourceLoaderFileModule.php
+++ b/includes/resourceloader/ResourceLoaderFileModule.php
@@ -479,7 +479,7 @@
}
$contents = file_get_contents( $localPath );
if ( $this-getConfig()-get( 'ResourceLoaderValidateStaticJS' 
) ) {
-   $contents = $this-validateScriptFile( $fileName, 
$contents );
+   $contents = $this-validateScriptFile( $localPath, 
$contents );
}
return $contents;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/153638
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7f36449cb352f50ba795a6d306e5d949a3dbd29
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Correctly handle incorrect namespace in cleanupTitles.php - change (mediawiki/core)

2014-08-12 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/153644

Change subject: Correctly handle incorrect namespace in cleanupTitles.php
..

Correctly handle incorrect namespace in cleanupTitles.php

If the namespace is not valid; Title::makeTitleSafe() will
return null, thus producing a fatal error. Work arround this
by setting the namespace to 0 in that case.

Bug: 68501
Change-Id: I0c22f9468ff2bf11d2bf4a9265fa454ece2c0fa3
---
M maintenance/cleanupTitles.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/44/153644/1

diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php
index 72b6aa5..eee1204 100644
--- a/maintenance/cleanupTitles.php
+++ b/maintenance/cleanupTitles.php
@@ -148,6 +148,12 @@
$ns = 0;
}
 
+   # Namespace which no longer exists. Put the page in the 
main namespace
+   # since we don't have any idea of the old namespace 
name. See bug 68501.
+   if ( !MWNamespace::exists( $ns ) ) {
+   $ns = 0;
+   }
+
$clean = 'Broken/' . $prior;
$verified = Title::makeTitleSafe( $ns, $clean );
if ( $verified-exists() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/153644
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c22f9468ff2bf11d2bf4a9265fa454ece2c0fa3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Don't set the session name in CLI or when sessions are deact... - change (mediawiki/core)

2014-08-04 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/151722

Change subject: Don't set the session name in CLI or when sessions are 
deactivated
..

Don't set the session name in CLI or when sessions are deactivated

It doesn't make much sense to set the session name in that case.

Change-Id: I4cf237d79061d146091c3409b7ac3e19136f3fb6
---
M includes/Setup.php
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/151722/1

diff --git a/includes/Setup.php b/includes/Setup.php
index 03c529e..3a41c05 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -558,15 +558,15 @@
 
 wfProfileIn( $fname . '-session' );
 
-// If session.auto_start is there, we can't touch session name
-if ( !wfIniGetBool( 'session.auto_start' ) ) {
-   session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . 
'_session' );
-}
+if ( !defined( 'MW_NO_SESSION' )  !$wgCommandLineMode ) {
+   // If session.auto_start is there, we can't touch session name
+   if ( !wfIniGetBool( 'session.auto_start' ) ) {
+   session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix 
. '_session' );
+   }
 
-if ( !defined( 'MW_NO_SESSION' )  !$wgCommandLineMode 
-   ( $wgRequest-checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 
'Token'] ) )
-) {
-   wfSetupSession();
+   if ( $wgRequest-checkSessionCookie() || isset( 
$_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
+   wfSetupSession();
+   }
 }
 
 wfProfileOut( $fname . '-session' );

-- 
To view, visit https://gerrit.wikimedia.org/r/151722
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4cf237d79061d146091c3409b7ac3e19136f3fb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Group E-mail settings stuff in Setup.php - change (mediawiki/core)

2014-08-04 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/151768

Change subject: Group E-mail settings stuff in Setup.php
..

Group E-mail settings stuff in Setup.php

- Move the overrides of e-mail settings along with other
  configuration corrections instead of being near global object
  definitions
- Also force $wgUseEnotif to false if $wgEnableEmail;
  previously it could remain true since $wgEnotifUserTalk
  and $wgEnotifWatchlist were forced to false after they
  were checked to set $wgUseEnotif
- Also put the removal of 'enotifminoredits' preference nearby

Change-Id: I9af6bb78d34ce053fc36eaa7cc3852de3ecbee8e
---
M includes/Setup.php
1 file changed, 27 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/151768/1

diff --git a/includes/Setup.php b/includes/Setup.php
index 03c529e..15fe94a 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -293,7 +293,33 @@
 }
 $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +.\'\\[', '__' );
 
-$wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
+if ( $wgEnableEmail ) {
+   $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
+} else {
+   // Disable all other email settings automatically if $wgEnableEmail
+   // is set to false. - bug 63678
+   $wgAllowHTMLEmail = false;
+   $wgEmailAuthentication = false; // do not require auth if you're not 
sending email anyway
+   $wgEnableUserEmail = false;
+   $wgEnotifFromEditor = false;
+   $wgEnotifImpersonal = false;
+   $wgEnotifMaxRecips = 0;
+   $wgEnotifMinorEdits = false;
+   $wgEnotifRevealEditorAddress = false;
+   $wgEnotifUseJobQ = false;
+   $wgEnotifUseRealName = false;
+   $wgEnotifUserTalk = false;
+   $wgEnotifWatchlist = false;
+   unset( $wgGroupPermissions['user']['sendemail'] );
+   $wgUseEnotif = false;
+   $wgUserEmailUseReplyTo = false;
+   $wgUsersNotifiedOnAllChanges = array();
+}
+
+// Doesn't make sense to have if disabled.
+if ( !$wgEnotifMinorEdits ) {
+   $wgHiddenPrefs[] = 'enotifminoredits';
+}
 
 if ( $wgMetaNamespace === false ) {
$wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
@@ -344,11 +370,6 @@
 if ( $wgUseFileCache || $wgUseSquid ) {
$wgShowIPinHeader = false;
$wgDebugToolbar = false;
-}
-
-// Doesn't make sense to have if disabled.
-if ( !$wgEnotifMinorEdits ) {
-   $wgHiddenPrefs[] = 'enotifminoredits';
 }
 
 // We always output HTML5 since 1.22, overriding these is no longer supported
@@ -613,26 +634,6 @@
 $wgTitle = null;
 
 $wgDeferredUpdateList = array();
-
-// Disable all other email settings automatically if $wgEnableEmail
-// is set to false. - bug 63678
-if ( !$wgEnableEmail ) {
-   $wgAllowHTMLEmail = false;
-   $wgEmailAuthentication = false; // do not require auth if you're not 
sending email anyway
-   $wgEnableUserEmail = false;
-   $wgEnotifFromEditor = false;
-   $wgEnotifImpersonal = false;
-   $wgEnotifMaxRecips = 0;
-   $wgEnotifMinorEdits = false;
-   $wgEnotifRevealEditorAddress = false;
-   $wgEnotifUseJobQ = false;
-   $wgEnotifUseRealName = false;
-   $wgEnotifUserTalk = false;
-   $wgEnotifWatchlist = false;
-   unset( $wgGroupPermissions['user']['sendemail'] );
-   $wgUserEmailUseReplyTo = false;
-   $wgUsersNotifiedOnAllChanges = array();
-}
 
 wfProfileOut( $fname . '-globals' );
 wfProfileIn( $fname . '-extensions' );

-- 
To view, visit https://gerrit.wikimedia.org/r/151768
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9af6bb78d34ce053fc36eaa7cc3852de3ecbee8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Move debug log related settings up in Setup.php - change (mediawiki/core)

2014-08-04 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/151769

Change subject: Move debug log related settings up in Setup.php
..

Move debug log related settings up in Setup.php

Since this doesn't rely on functions defined in GlobalFunctions.php;
this can be in the first defaults section of the file.

Change-Id: I24f1a14322d90d053adf51716516001477364e16
---
M includes/Setup.php
1 file changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/151769/1

diff --git a/includes/Setup.php b/includes/Setup.php
index 03c529e..1641d10 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -405,6 +405,16 @@
);
 }
 
+// Back compatibility for $wgRateLimitLog deprecated with 1.23
+if ( $wgRateLimitLog  !array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
+   $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
+}
+
+if ( $wgProfileOnly ) {
+   $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
+   $wgDebugLogFile = '';
+}
+
 wfProfileOut( $fname . '-defaults' );
 
 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
@@ -484,16 +494,6 @@
'port' = $wgHTCPPort,
)
);
-}
-
-// Back compatibility for $wgRateLimitLog deprecated with 1.23
-if ( $wgRateLimitLog  !array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
-   $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
-}
-
-if ( $wgProfileOnly ) {
-   $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
-   $wgDebugLogFile = '';
 }
 
 wfProfileOut( $fname . '-defaults2' );

-- 
To view, visit https://gerrit.wikimedia.org/r/151769
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I24f1a14322d90d053adf51716516001477364e16
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use camel case for variable names in Article.php - change (mediawiki/core)

2014-08-02 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/151288

Change subject: Use camel case for variable names in Article.php
..

Use camel case for variable names in Article.php

Found only one which was not using it.

Change-Id: I92a0268a70db0f741c1b83bb08b20717d4168043
---
M includes/page/Article.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/151288/1

diff --git a/includes/page/Article.php b/includes/page/Article.php
index 436f148..5566db3 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1551,9 +1551,9 @@
$user = $this-getContext()-getUser();
 
# Check permissions
-   $permission_errors = $title-getUserPermissionsErrors( 
'delete', $user );
-   if ( count( $permission_errors ) ) {
-   throw new PermissionsError( 'delete', 
$permission_errors );
+   $permissionErrors = $title-getUserPermissionsErrors( 'delete', 
$user );
+   if ( count( $permissionErrors ) ) {
+   throw new PermissionsError( 'delete', $permissionErrors 
);
}
 
# Read-only check...

-- 
To view, visit https://gerrit.wikimedia.org/r/151288
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92a0268a70db0f741c1b83bb08b20717d4168043
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Deglobalise some special pages - change (mediawiki/core)

2014-08-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/151085

Change subject: Deglobalise some special pages
..

Deglobalise some special pages

Change-Id: Ib983d7ee7817139d3c016df2f10deb7385927f06
---
M includes/specials/SpecialBooksources.php
M includes/specials/SpecialCategories.php
M includes/specials/SpecialChangePassword.php
M includes/specials/SpecialContributions.php
M includes/specials/SpecialDeletedContributions.php
5 files changed, 12 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/151085/1

diff --git a/includes/specials/SpecialBooksources.php 
b/includes/specials/SpecialBooksources.php
index 581619f..2a1902f 100644
--- a/includes/specials/SpecialBooksources.php
+++ b/includes/specials/SpecialBooksources.php
@@ -117,15 +117,14 @@
 * @return string
 */
private function makeForm() {
-   global $wgScript;
-
$form = Html::openElement( 'fieldset' ) . \n;
$form .= Html::element(
'legend',
array(),
$this-msg( 'booksources-search-legend' )-text()
) . \n;
-   $form .= Html::openElement( 'form', array( 'method' = 'get', 
'action' = $wgScript ) ) . \n;
+   $form .= Html::openElement( 'form', array(
+   'method' = 'get', 'action' = $this-getConfig()-get( 
'Script' ) ) ) . \n;
$form .= Html::hidden( 'title', 
$this-getPageTitle()-getPrefixedText() ) . \n;
$form .= 'p' . Xml::inputLabel(
$this-msg( 'booksources-isbn' )-text(),
diff --git a/includes/specials/SpecialCategories.php 
b/includes/specials/SpecialCategories.php
index 3367bd4..d3e2822 100644
--- a/includes/specials/SpecialCategories.php
+++ b/includes/specials/SpecialCategories.php
@@ -180,11 +180,9 @@
}
 
public function getStartForm( $from ) {
-   global $wgScript;
-
return Xml::tags(
'form',
-   array( 'method' = 'get', 'action' = $wgScript ),
+   array( 'method' = 'get', 'action' = 
$this-getConfig()-get( 'Script' ) ),
Html::hidden( 'title', 
$this-getTitle()-getPrefixedText() ) .
Xml::fieldset(
$this-msg( 'categories' )-text(),
diff --git a/includes/specials/SpecialChangePassword.php 
b/includes/specials/SpecialChangePassword.php
index ad1d597..11f060d 100644
--- a/includes/specials/SpecialChangePassword.php
+++ b/includes/specials/SpecialChangePassword.php
@@ -77,8 +77,6 @@
}
 
protected function getFormFields() {
-   global $wgCookieExpiration;
-
$user = $this-getUser();
$request = $this-getRequest();
 
@@ -131,10 +129,11 @@
}
 
if ( !$user-isLoggedIn() ) {
+   $cookieExpiration = $this-getConfig()-get( 
'CookieExpiration' );
$fields['Remember'] = array(
'type' = 'check',
'label' = $this-msg( 'remembermypassword' )
-   -numParams( ceil( 
$wgCookieExpiration / ( 3600 * 24 ) ) )
+   -numParams( ceil( 
$cookieExpiration / ( 3600 * 24 ) ) )
-text(),
'default' = $request-getVal( 'wpRemember' ),
);
@@ -233,8 +232,6 @@
 * @throws PasswordError When cannot set the new password because 
requirements not met.
 */
protected function attemptReset( $oldpass, $newpass, $retype ) {
-   global $wgPasswordAttemptThrottle;
-
$isSelf = ( $this-mUserName === $this-getUser()-getName() );
if ( $isSelf ) {
$user = $this-getUser();
@@ -254,8 +251,9 @@
$throttleCount = LoginForm::incLoginThrottle( $this-mUserName 
);
if ( $throttleCount === true ) {
$lang = $this-getLanguage();
+   $passwordAttemptThrottle = $this-getConfig()-get( 
'PasswordAttemptThrottle' );
throw new PasswordError( $this-msg( 
'changepassword-throttled' )
-   -params( $lang-formatDuration( 
$wgPasswordAttemptThrottle['seconds'] ) )
+   -params( $lang-formatDuration( 
$passwordAttemptThrottle['seconds'] ) )
-text()
);
}
diff --git a/includes/specials/SpecialContributions.php 
b/includes/specials/SpecialContributions.php
index a884a39..dd5a3eb 100644
--- a/includes/specials/SpecialContributions.php

[MediaWiki-commits] [Gerrit] Factorise $this-getTitle() call in Article::confirmDelete() - change (mediawiki/core)

2014-08-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/151086

Change subject: Factorise $this-getTitle() call in Article::confirmDelete()
..

Factorise $this-getTitle() call in Article::confirmDelete()

Call it once instead of seven times.

Change-Id: I2f4d298a15046c4dc02afbf7582c90a1f17ea4cb
---
M includes/page/Article.php
1 file changed, 8 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/151086/1

diff --git a/includes/page/Article.php b/includes/page/Article.php
index a189c2e..436f148 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1657,11 +1657,12 @@
public function confirmDelete( $reason ) {
wfDebug( Article::confirmDelete\n );
 
+   $title = $this-getTitle();
$outputPage = $this-getContext()-getOutput();
-   $outputPage-setPageTitle( wfMessage( 'delete-confirm', 
$this-getTitle()-getPrefixedText() ) );
-   $outputPage-addBacklinkSubtitle( $this-getTitle() );
+   $outputPage-setPageTitle( wfMessage( 'delete-confirm', 
$title-getPrefixedText() ) );
+   $outputPage-addBacklinkSubtitle( $title );
$outputPage-setRobotPolicy( 'noindex,nofollow' );
-   $backlinkCache = $this-getTitle()-getBacklinkCache();
+   $backlinkCache = $title-getBacklinkCache();
if ( $backlinkCache-hasLinks( 'pagelinks' ) || 
$backlinkCache-hasLinks( 'templatelinks' ) ) {
$outputPage-wrapWikiMsg( div class='mw-warning 
plainlinks'\n$1\n/div\n,
'deleting-backlinks-warning' );
@@ -1683,10 +1684,10 @@
} else {
$suppress = '';
}
-   $checkWatch = $user-getBoolOption( 'watchdeletion' ) || 
$user-isWatched( $this-getTitle() );
+   $checkWatch = $user-getBoolOption( 'watchdeletion' ) || 
$user-isWatched( $title );
 
$form = Xml::openElement( 'form', array( 'method' = 'post',
-   'action' = $this-getTitle()-getLocalURL( 
'action=delete' ), 'id' = 'deleteconfirm' ) ) .
+   'action' = $title-getLocalURL( 'action=delete' ), 
'id' = 'deleteconfirm' ) ) .
Xml::openElement( 'fieldset', array( 'id' = 
'mw-delete-table' ) ) .
Xml::tags( 'legend', null, wfMessage( 'delete-legend' 
)-escaped() ) .
Xml::openElement( 'table', array( 'id' = 
'mw-deleteconfirm-table' ) ) .
@@ -1745,7 +1746,7 @@
Xml::closeElement( 'fieldset' ) .
Html::hidden(
'wpEditToken',
-   $user-getEditToken( array( 'delete', 
$this-getTitle()-getPrefixedText() ) )
+   $user-getEditToken( array( 'delete', 
$title-getPrefixedText() ) )
) .
Xml::closeElement( 'form' );
 
@@ -1764,9 +1765,7 @@
 
$deleteLogPage = new LogPage( 'delete' );
$outputPage-addHTML( Xml::element( 'h2', null, 
$deleteLogPage-getName()-text() ) );
-   LogEventsList::showLogExtract( $outputPage, 'delete',
-   $this-getTitle()
-   );
+   LogEventsList::showLogExtract( $outputPage, 'delete', $title );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/151086
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f4d298a15046c4dc02afbf7582c90a1f17ea4cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove useless temporary variable in Setup.php - change (mediawiki/core)

2014-07-31 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/150886

Change subject: Remove useless temporary variable in Setup.php
..

Remove useless temporary variable in Setup.php

Also makes the definition of $wgLocalFileRepo consistent.

Change-Id: I6fc7a6e938699ded90eca577dd005a77466cbeee
---
M includes/Setup.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/150886/1

diff --git a/includes/Setup.php b/includes/Setup.php
index d551e76..03c529e 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -169,7 +169,6 @@
  * Initialise $wgLocalFileRepo from backwards-compatible settings
  */
 if ( !$wgLocalFileRepo ) {
-   $deletedHashLevel = $wgHashedUploadDirectory ? 3 : 0;
$wgLocalFileRepo = array(
'class' = 'LocalRepo',
'name' = 'local',
@@ -181,7 +180,7 @@
'thumbScriptUrl' = $wgThumbnailScriptPath,
'transformVia404' = !$wgGenerateThumbnailOnParse,
'deletedDir' = $wgDeletedDirectory,
-   'deletedHashLevels' = $deletedHashLevel
+   'deletedHashLevels' = $wgHashedUploadDirectory ? 3 : 0
);
 }
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/150886
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6fc7a6e938699ded90eca577dd005a77466cbeee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add method XmlSelect::addAttributes() and use it in HTMLSele... - change (mediawiki/core)

2014-07-08 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144671

Change subject: Add method XmlSelect::addAttributes() and use it in 
HTMLSelectField
..

Add method XmlSelect::addAttributes() and use it in HTMLSelectField

So that multiple attributes can be set in a single call, which
avoids having to do a foreach loop to call setAttribute().

Change-Id: I7b32d79766e06444f87d16d6566f7de8afecfebe
---
M includes/Xml.php
M includes/htmlform/HTMLSelectField.php
2 files changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/144671/1

diff --git a/includes/Xml.php b/includes/Xml.php
index 6fb5380..96d37a7 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -909,6 +909,13 @@
}
 
/**
+* @param array $attrs
+*/
+   public function addAttributes( array $attrs ) {
+   $this-attributes += $attrs;
+   }
+
+   /**
 * @param string $name
 * @return array|null
 */
diff --git a/includes/htmlform/HTMLSelectField.php 
b/includes/htmlform/HTMLSelectField.php
index 2bf9f8b..93fc858 100644
--- a/includes/htmlform/HTMLSelectField.php
+++ b/includes/htmlform/HTMLSelectField.php
@@ -28,10 +28,7 @@
}
 
$allowedParams = array( 'tabindex', 'size' );
-   $customParams = $this-getAttributes( $allowedParams );
-   foreach( $customParams as $name = $value ) {
-   $select-setAttribute( $name, $value );
-   }
+   $select-addAttributes( $this-getAttributes( $allowedParams ) 
);
 
if ( $this-mClass !== '' ) {
$select-setAttribute( 'class', $this-mClass );

-- 
To view, visit https://gerrit.wikimedia.org/r/144671
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b32d79766e06444f87d16d6566f7de8afecfebe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix the (un)watch token to include the namespace name. - change (mediawiki/core)

2014-07-08 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144749

Change subject: Fix the (un)watch token to include the namespace name.
..

Fix the (un)watch token to include the namespace name.

Title::getDBkey() only returns the page name without the namespace
which means that Test and User:Test (for example) pages would
have the same token; use Title::getPrefixedDBkey() instead to
avoid this.

Change-Id: I80333b23cec0cfe6546f6e7776b0a77b56ee20c8
---
M includes/actions/WatchAction.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/144749/1

diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php
index 2c7502e..3b3ae1d 100644
--- a/includes/actions/WatchAction.php
+++ b/includes/actions/WatchAction.php
@@ -185,7 +185,7 @@
if ( $action != 'unwatch' ) {
$action = 'watch';
}
-   $salt = array( $action, $title-getDBkey() );
+   $salt = array( $action, $title-getPrefixedDBkey() );
 
// This token stronger salted and not compatible with ApiWatch
// It's title/action specific because index.php is GET and API 
is POST

-- 
To view, visit https://gerrit.wikimedia.org/r/144749
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80333b23cec0cfe6546f6e7776b0a77b56ee20c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use the user from the context to format the date in Block::g... - change (mediawiki/core)

2014-07-08 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144755

Change subject: Use the user from the context to format the date in 
Block::getPermissionsError()
..

Use the user from the context to format the date in Block::getPermissionsError()

Language::timeanddate() uses $wgUser to get the time correction and the
format to use.

Change-Id: I7dee3ae523d99aec7b36a317612a61376cf26d21
---
M includes/Block.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/144755/1

diff --git a/includes/Block.php b/includes/Block.php
index 3896369..c393a79 100644
--- a/includes/Block.php
+++ b/includes/Block.php
@@ -1368,7 +1368,7 @@
$this-getId(),
$lang-formatExpiry( $this-mExpiry ),
(string)$intended,
-   $lang-timeanddate( wfTimestamp( TS_MW, 
$this-mTimestamp ), true ),
+   $lang-userTimeAndDate( $this-mTimestamp, 
$context-getUser() ),
);
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/144755
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7dee3ae523d99aec7b36a317612a61376cf26d21
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Allow to set a salt for the edit token in HTMLForm - change (mediawiki/core)

2014-07-08 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144766

Change subject: Allow to set a salt for the edit token in HTMLForm
..

Allow to set a salt for the edit token in HTMLForm

And set one in RevertAction.

Change-Id: I9f72c6203e8d9d0770009083263ddca98845f530
---
M includes/actions/RevertAction.php
M includes/htmlform/HTMLForm.php
2 files changed, 24 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/144766/1

diff --git a/includes/actions/RevertAction.php 
b/includes/actions/RevertAction.php
index cdd139e..92428cf 100644
--- a/includes/actions/RevertAction.php
+++ b/includes/actions/RevertAction.php
@@ -86,6 +86,7 @@
$form-setWrapperLegendMsg( 'filerevert-legend' );
$form-setSubmitTextMsg( 'filerevert-submit' );
$form-addHiddenField( 'oldimage', 
$this-getRequest()-getText( 'oldimage' ) );
+   $form-setTokenSalt( array( 'revert', 
$this-getTitle()-getPrefixedDBkey() ) );
}
 
protected function getFormFields() {
diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index b57b69d..3334694 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -172,6 +172,12 @@
protected $mWrapperLegend = false;
 
/**
+* Salt for the edit token.
+* @var string|array
+*/
+   protected $mTokenSalt = '';
+
+   /**
 * If true, sections that contain both fields and subsections will
 * render their subsections before their fields.
 *
@@ -397,7 +403,7 @@
// Session tokens for logged-out users have no 
security value.
// However, if the user gave one, check it in 
order to give a nice
// session expired error instead of 
permission denied or such.
-   $submit = $this-getUser()-matchEditToken( 
$editToken );
+   $submit = $this-getUser()-matchEditToken( 
$editToken, $this-mTokenSalt );
} else {
$submit = true;
}
@@ -729,6 +735,21 @@
}
 
/**
+* Set the salt for the edit token.
+*
+* Only useful when the method is post.
+*
+* @since 1.24
+* @param string|array Salt to use
+* @return HTMLForm $this for chaining calls
+*/
+   public function setTokenSalt( $salt ) {
+   $this-mTokenSalt = $salt;
+
+   return $this;
+   }
+
+   /**
 * Display the form (sending to the context's OutputPage object), with 
an
 * appropriate error message or stack of messages, and any validation 
errors, etc.
 *
@@ -823,7 +844,7 @@
if ( $this-getMethod() == 'post' ) {
$html .= Html::hidden(
'wpEditToken',
-   $this-getUser()-getEditToken(),
+   $this-getUser()-getEditToken( 
$this-mTokenSalt ),
array( 'id' = 'wpEditToken' )
) . \n;
$html .= Html::hidden( 'title', 
$this-getTitle()-getPrefixedText() ) . \n;

-- 
To view, visit https://gerrit.wikimedia.org/r/144766
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f72c6203e8d9d0770009083263ddca98845f530
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove tabindex from the drop-down in Special:RevisionDelete - change (mediawiki/core)

2014-07-06 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144348

Change subject: Remove tabindex from the drop-down in Special:RevisionDelete
..

Remove tabindex from the drop-down in Special:RevisionDelete

It is the element in the form which has this attribute set,
so the tab order was not correct.

bug: 67271
Change-Id: Ifa8fb91f9bf7a60e727ec7376d2bc3a851007634
---
M includes/specials/SpecialRevisiondelete.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/144348/1

diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index d3b168b..b90026a 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -417,7 +417,7 @@
Xml::listDropDown( 
'wpRevDeleteReasonList',
$this-msg( 
'revdelete-reason-dropdown' )-inContentLanguage()-text(),
$this-msg( 
'revdelete-reasonotherlist' )-inContentLanguage()-text(),
-   
$this-getRequest()-getText( 'wpRevDeleteReasonList', 'other' ), 
'wpReasonDropDown', 1
+   
$this-getRequest()-getText( 'wpRevDeleteReasonList', 'other' ), 
'wpReasonDropDown'
) .
'/td' .
/trtr\n .

-- 
To view, visit https://gerrit.wikimedia.org/r/144348
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa8fb91f9bf7a60e727ec7376d2bc3a851007634
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Allow size attribute to HTMLSelectField - change (mediawiki/core)

2014-07-06 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144371

Change subject: Allow size attribute to HTMLSelectField
..

Allow size attribute to HTMLSelectField

Pass this one to XmlSelect is provided.

Change-Id: I7ac345e1c219c8607895f9fc0fc2cef68c900ff8
---
M includes/htmlform/HTMLSelectField.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/144371/1

diff --git a/includes/htmlform/HTMLSelectField.php 
b/includes/htmlform/HTMLSelectField.php
index c32b445..2bf9f8b 100644
--- a/includes/htmlform/HTMLSelectField.php
+++ b/includes/htmlform/HTMLSelectField.php
@@ -27,8 +27,10 @@
$select-setAttribute( 'disabled', 'disabled' );
}
 
-   if ( isset( $this-mParams['tabindex'] ) ) {
-   $select-setAttribute( 'tabindex', 
$this-mParams['tabindex'] );
+   $allowedParams = array( 'tabindex', 'size' );
+   $customParams = $this-getAttributes( $allowedParams );
+   foreach( $customParams as $name = $value ) {
+   $select-setAttribute( $name, $value );
}
 
if ( $this-mClass !== '' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/144371
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ac345e1c219c8607895f9fc0fc2cef68c900ff8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Some misc cleanup to ProtectionForm - change (mediawiki/core)

2014-07-06 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144372

Change subject: Some misc cleanup to ProtectionForm
..

Some misc cleanup to ProtectionForm

- Set variables near to where they are used in buildForm()
  and put variables that only need to be set once out of loops
- Move the definition of 'wgCascadeableLevels' javascript variable
  near the inclusion of mediawiki.legacy.protect module, so that
  this doesn't need to be set as a side effect of buildCleanupScript()

Change-Id: Ifb54723e7609f6fc5a8939e4fada5c2e664a22bd
---
M includes/ProtectionForm.php
1 file changed, 22 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/144372/1

diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php
index 456e4e6..853e2cc 100644
--- a/includes/ProtectionForm.php
+++ b/includes/ProtectionForm.php
@@ -338,20 +338,12 @@
 * @return string HTML form
 */
function buildForm() {
-   global $wgUser, $wgLang, $wgOut;
-
-   $mProtectreasonother = Xml::label(
-   wfMessage( 'protectcomment' )-text(),
-   'wpProtectReasonSelection'
-   );
-   $mProtectreason = Xml::label(
-   wfMessage( 'protect-otherreason' )-text(),
-   'mwProtect-reason'
-   );
+   global $wgUser, $wgLang, $wgOut, $wgCascadingRestrictionLevels;
 
$out = '';
if ( !$this-disabled ) {
$wgOut-addModules( 'mediawiki.legacy.protect' );
+   $wgOut-addJsConfigVars( 'wgCascadeableLevels', 
$wgCascadingRestrictionLevels );
$out .= Xml::openElement( 'form', array( 'method' = 
'post',
'action' = $this-mTitle-getLocalURL( 
'action=protect' ),
'id' = 'mw-Protect-Form', 'onsubmit' = 
'ProtectionForm.enableUnchainedInputs(true)' ) );
@@ -361,6 +353,9 @@
Xml::element( 'legend', null, wfMessage( 
'protect-legend' )-text() ) .
Xml::openElement( 'table', array( 'id' = 
'mwProtectSet' ) ) .
Xml::openElement( 'tbody' );
+
+   $scExpiryOptions = wfMessage( 'protect-expiry-options' 
)-inContentLanguage()-text();
+   $showProtectOptions = $scExpiryOptions !== '-'  
!$this-disabled;
 
// Not all languages have V_x - N_x relation
foreach ( $this-mRestrictions as $action = $selected ) {
@@ -372,15 +367,6 @@
Xml::element( 'legend', null, $msg-exists() ? 
$msg-text() : $action ) .
Xml::openElement( 'table', array( 'id' = 
mw-protect-table-$action ) ) .
trtd . $this-buildSelector( $action, 
$selected ) . /td/trtrtd;
-
-   $reasonDropDown = Xml::listDropDown( 
'wpProtectReasonSelection',
-   wfMessage( 'protect-dropdown' 
)-inContentLanguage()-text(),
-   wfMessage( 'protect-otherreason-op' 
)-inContentLanguage()-text(),
-   $this-mReasonSelection,
-   'mwProtect-reason', 4 );
-   $scExpiryOptions = wfMessage( 'protect-expiry-options' 
)-inContentLanguage()-text();
-
-   $showProtectOptions = $scExpiryOptions !== '-'  
!$this-disabled;
 
$mProtectexpiry = Xml::label(
wfMessage( 'protectexpiry' )-text(),
@@ -482,6 +468,22 @@
 
# Add manual and custom reason field/selects as well as submit
if ( !$this-disabled ) {
+   $mProtectreasonother = Xml::label(
+   wfMessage( 'protectcomment' )-text(),
+   'wpProtectReasonSelection'
+   );
+
+   $mProtectreason = Xml::label(
+   wfMessage( 'protect-otherreason' )-text(),
+   'mwProtect-reason'
+   );
+
+   $reasonDropDown = Xml::listDropDown( 
'wpProtectReasonSelection',
+   wfMessage( 'protect-dropdown' 
)-inContentLanguage()-text(),
+   wfMessage( 'protect-otherreason-op' 
)-inContentLanguage()-text(),
+   $this-mReasonSelection,
+   'mwProtect-reason', 4 );
+
$out .= Xml::openElement( 'table', array( 'id' = 
'mw-protect-table3' ) ) .
Xml::openElement( 'tbody' );
$out .= 
@@ -606,9 +608,6 @@
}
 
function buildCleanupScript() {
-   global 

[MediaWiki-commits] [Gerrit] Don't use isset to check for null - change (mediawiki/core)

2014-07-04 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144177

Change subject: Don't use isset to check for null
..

Don't use isset to check for null

Change isset() checks for variables that are always defined.

Change-Id: Ic96b9661d94742909c0d6b62a8eb2f6a038a774f
---
M includes/Setup.php
M includes/SiteConfiguration.php
M includes/Skin.php
M includes/Title.php
M includes/User.php
5 files changed, 15 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/77/144177/1

diff --git a/includes/Setup.php b/includes/Setup.php
index 67d8da3..fd4465b 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -114,7 +114,7 @@
 isset( $wgFooterIcons['copyright']['copyright'] )
 $wgFooterIcons['copyright']['copyright'] === array()
 ) {
-   if ( isset( $wgCopyrightIcon )  $wgCopyrightIcon ) {
+   if ( $wgCopyrightIcon ) {
$wgFooterIcons['copyright']['copyright'] = $wgCopyrightIcon;
} elseif ( $wgRightsIcon || $wgRightsText ) {
$wgFooterIcons['copyright']['copyright'] = array(
diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php
index b99840f..b7fa6ec 100644
--- a/includes/SiteConfiguration.php
+++ b/includes/SiteConfiguration.php
@@ -207,14 +207,14 @@
// Do tag settings
foreach ( $params['tags'] as $tag ) {
if ( array_key_exists( $tag, 
$thisSetting ) ) {
-   if ( isset( $retval )  
is_array( $retval )  is_array( $thisSetting[$tag] ) ) {
+   if ( is_array( $retval )  
is_array( $thisSetting[$tag] ) ) {
$retval = 
self::arrayMerge( $retval, $thisSetting[$tag] );
} else {
$retval = 
$thisSetting[$tag];
}
break 2;
} elseif ( array_key_exists( +$tag, 
$thisSetting )  is_array( $thisSetting[+$tag] ) ) {
-   if ( !isset( $retval ) ) {
+   if ( $retval === null ) {
$retval = array();
}
$retval = self::arrayMerge( 
$retval, $thisSetting[+$tag] );
@@ -224,7 +224,7 @@
$suffix = $params['suffix'];
if ( !is_null( $suffix ) ) {
if ( array_key_exists( $suffix, 
$thisSetting ) ) {
-   if ( isset( $retval )  
is_array( $retval )  is_array( $thisSetting[$suffix] ) ) {
+   if ( is_array( $retval )  
is_array( $thisSetting[$suffix] ) ) {
$retval = 
self::arrayMerge( $retval, $thisSetting[$suffix] );
} else {
$retval = 
$thisSetting[$suffix];
@@ -233,7 +233,7 @@
} elseif ( array_key_exists( 
+$suffix, $thisSetting )
 is_array( 
$thisSetting[+$suffix] )
) {
-   if ( !isset( $retval ) ) {
+   if ( $retval === null ) {
$retval = array();
}
$retval = self::arrayMerge( 
$retval, $thisSetting[+$suffix] );
diff --git a/includes/Skin.php b/includes/Skin.php
index 177e2b1..14cd7af 100644
--- a/includes/Skin.php
+++ b/includes/Skin.php
@@ -875,7 +875,7 @@
 
$out = '';
 
-   if ( isset( $wgCopyrightIcon )  $wgCopyrightIcon ) {
+   if ( $wgCopyrightIcon ) {
$out = $wgCopyrightIcon;
} elseif ( $wgRightsIcon ) {
$icon = htmlspecialchars( $wgRightsIcon );
diff --git a/includes/Title.php b/includes/Title.php
index e038cc7..22511b0 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -2569,7 +2569,7 @@
return false;
}
 
-   if ( !isset( $this-mTitleProtection ) ) {
+   if ( $this-mTitleProtection === null ) {
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr-select(

[MediaWiki-commits] [Gerrit] Don't use isset() to check for null - change (mediawiki/core)

2014-07-03 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144047

Change subject: Don't use isset() to check for null
..

Don't use isset() to check for null

- Remove isset for defined member variables
- Add a missing definition of member variable $mTextId
- Fix documentation of $mTextRow
- Standardize checks for null to use === null or !== null
  instead of is_null()

Change-Id: I56e364bc14b5a3961a2538371ae4b0088babc5c7
---
M includes/Revision.php
1 file changed, 24 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/144047/1

diff --git a/includes/Revision.php b/includes/Revision.php
index 06f5bd0..de69827 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -41,6 +41,11 @@
protected $mParentId;
protected $mComment;
protected $mText;
+   protected $mTextId;
+
+   /**
+* @var stdClass|null
+*/
protected $mTextRow;
 
/**
@@ -299,7 +304,7 @@
private static function newFromConds( $conditions, $flags = 0 ) {
$db = wfGetDB( ( $flags  self::READ_LATEST ) ? DB_MASTER : 
DB_SLAVE );
$rev = self::loadFromConds( $db, $conditions, $flags );
-   if ( is_null( $rev )  wfGetLB()-getServerCount()  1 ) {
+   if ( $rev === null  wfGetLB()-getServerCount()  1 ) {
if ( !( $flags  self::READ_LATEST ) ) {
$dbw = wfGetDB( DB_MASTER );
$rev = self::loadFromConds( $dbw, $conditions, 
$flags );
@@ -566,13 +571,13 @@
$this-mTitle = null;
}
 
-   if ( !isset( $row-rev_content_model ) || is_null( 
$row-rev_content_model ) ) {
+   if ( !isset( $row-rev_content_model ) ) {
$this-mContentModel = null; # determine on 
demand if needed
} else {
$this-mContentModel = strval( 
$row-rev_content_model );
}
 
-   if ( !isset( $row-rev_content_format ) || is_null( 
$row-rev_content_format ) ) {
+   if ( !isset( $row-rev_content_format ) ) {
$this-mContentFormat = null; # determine on 
demand if needed
} else {
$this-mContentFormat = strval( 
$row-rev_content_format );
@@ -652,7 +657,7 @@
$this-mContentHandler = null;
 
$this-mText = $handler-serializeContent( 
$row['content'], $this-getContentFormat() );
-   } elseif ( !is_null( $this-mText ) ) {
+   } elseif ( $this-mText !== null ) {
$handler = $this-getContentHandler();
$this-mContent = $handler-unserializeContent( 
$this-mText );
}
@@ -674,7 +679,7 @@
 
// If we still have no length, see it we have the text 
to figure it out
if ( !$this-mSize ) {
-   if ( !is_null( $this-mContent ) ) {
+   if ( $this-mContent !== null ) {
$this-mSize = 
$this-mContent-getSize();
} else {
#NOTE: this should never happen if we 
have either text or content object!
@@ -684,7 +689,7 @@
 
// Same for sha1
if ( $this-mSha1 === null ) {
-   $this-mSha1 = is_null( $this-mText ) ? null : 
self::base36Sha1( $this-mText );
+   $this-mSha1 = $this-mText === null ? null : 
self::base36Sha1( $this-mText );
}
 
// force lazy init
@@ -759,11 +764,11 @@
 * @return Title|null
 */
public function getTitle() {
-   if ( isset( $this-mTitle ) ) {
+   if ( $this-mTitle !== null ) {
return $this-mTitle;
}
//rev_id is defined as NOT NULL, but this revision may not yet 
have been inserted.
-   if ( !is_null( $this-mId ) ) {
+   if ( $this-mId !== null ) {
$dbr = wfGetDB( DB_SLAVE );
$row = $dbr-selectRow(
array( 'page', 'revision' ),
@@ -776,7 +781,7 @@
}
}
 
-   if ( !$this-mTitle  !is_null( $this-mPage )  $this-mPage 
 0 ) {
+   if ( !$this-mTitle  $this-mPage !== null  $this-mPage  
0 ) {
$this-mTitle = Title::newFromID( $this-mPage );
}
 
@@ -1031,7 +1036,7 @@
 * 

[MediaWiki-commits] [Gerrit] Force array parameters in SiteConfiguration - change (mediawiki/core)

2014-07-03 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/144049

Change subject: Force array parameters in SiteConfiguration
..

Force array parameters in SiteConfiguration

Now that we require PHP 5.1 (for quite some time actually)
we can force method parameters to be array.

Change-Id: Ia4a262320344e05cc1625c041a3aa4ec41034ad7
---
M includes/SiteConfiguration.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/144049/1

diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php
index b99840f..3c32ce2 100644
--- a/includes/SiteConfiguration.php
+++ b/includes/SiteConfiguration.php
@@ -191,7 +191,7 @@
 * @param array $params Array of parameters.
 * @return mixed The value of the setting requested.
 */
-   protected function getSetting( $settingName, $wiki, /*array*/ $params ) 
{
+   protected function getSetting( $settingName, $wiki, array $params ) {
$retval = null;
if ( array_key_exists( $settingName, $this-settings ) ) {
$thisSetting = $this-settings[$settingName];
@@ -450,7 +450,7 @@
 * @param array $wikiTags The tags assigned to the wiki.
 * @return array
 */
-   protected function mergeParams( $wiki, $suffix, /*array*/ $params, 
/*array*/ $wikiTags ) {
+   protected function mergeParams( $wiki, $suffix, array $params, array 
$wikiTags ) {
$ret = $this-getWikiParams( $wiki );
 
if ( is_null( $ret['suffix'] ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/144049
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4a262320344e05cc1625c041a3aa4ec41034ad7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Don't use isset() to check for null - change (mediawiki/core)

2014-07-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/143353

Change subject: Don't use isset() to check for null
..

Don't use isset() to check for null

Those two member variables are always defined.

Change-Id: I7d1b9319bb1ce212f730a0568961eefb963fc7df
---
M includes/Message.php
M includes/OutputPage.php
2 files changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/53/143353/1

diff --git a/includes/Message.php b/includes/Message.php
index 826d55b..950bcd5 100644
--- a/includes/Message.php
+++ b/includes/Message.php
@@ -995,7 +995,7 @@
 * @throws MWException If message key array is empty.
 */
protected function fetchMessage() {
-   if ( !isset( $this-message ) ) {
+   if ( $this-message === null ) {
$cache = MessageCache::singleton();
if ( is_array( $this-key ) ) {
if ( !count( $this-key ) ) {
@@ -1054,7 +1054,7 @@
 */
public function fetchMessage() {
// Just in case the message is unset somewhere.
-   if ( !isset( $this-message ) ) {
+   if ( $this-message === null ) {
$this-message = $this-key;
}
return $this-message;
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 2a96891..f8b1b3e 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -885,10 +885,7 @@
 * @return string
 */
public function getPageTitleActionText() {
-   if ( isset( $this-mPageTitleActionText ) ) {
-   return $this-mPageTitleActionText;
-   }
-   return '';
+   return $this-mPageTitleActionText;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/143353
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d1b9319bb1ce212f730a0568961eefb963fc7df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Don't use isset() to check for null - change (mediawiki/core)

2014-06-30 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/143085

Change subject: Don't use isset() to check for null
..

Don't use isset() to check for null

$wgLocalTZoffset is defined in DefaultSettings.php so it is always set.

Change-Id: I86518176b30da4e13f6dbfde8f1c77c8ced58d9f
---
M includes/MWTimestamp.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/143085/1

diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php
index 447dde3..ad3228d 100644
--- a/includes/MWTimestamp.php
+++ b/includes/MWTimestamp.php
@@ -268,7 +268,7 @@
// first value.
if ( $data[0] == 'System' ) {
// First value is System, so use the system offset.
-   if ( isset( $wgLocalTZoffset ) ) {
+   if ( $wgLocalTZoffset !== null ) {
$diff = $wgLocalTZoffset;
}
} elseif ( $data[0] == 'Offset' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/143085
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86518176b30da4e13f6dbfde8f1c77c8ced58d9f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use HTMLForm to generate the form on Special:ListFiles - change (mediawiki/core)

2014-06-29 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/142876

Change subject: Use HTMLForm to generate the form on Special:ListFiles
..

Use HTMLForm to generate the form on Special:ListFiles

- Makes the code easier to read
- This was actually the last usage of Xml::buildForm() in core
- Removed tabindex; not needed since the navigation is already
  in DOM order

Change-Id: Ie0a2819fdf28f734a8c68246be693de7259b8332
---
M includes/specials/SpecialListfiles.php
1 file changed, 50 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/76/142876/1

diff --git a/includes/specials/SpecialListfiles.php 
b/includes/specials/SpecialListfiles.php
index 3715b8b..23e8e56 100644
--- a/includes/specials/SpecialListfiles.php
+++ b/includes/specials/SpecialListfiles.php
@@ -491,43 +491,63 @@
}
 
function getForm() {
-   global $wgScript, $wgMiserMode;
-   $inputForm = array();
-   $inputForm['table_pager_limit_label'] = $this-getLimitSelect( 
array( 'tabindex' = 1 ) );
+   global $wgMiserMode;
+
+   $fields = array();
+   $fields['limit'] = array(
+   'type' = 'select',
+   'name' = 'limit',
+   'label-message' = 'table_pager_limit_label',
+   'options' = $this-getLimitSelectList(),
+   'default' = $this-mLimit,
+   );
+
if ( !$wgMiserMode ) {
-   $inputForm['listfiles_search_for'] = Html::input(
-   'ilsearch',
-   $this-mSearch,
-   'text',
-   array(
-   'size' = '40',
-   'maxlength' = '255',
-   'id' = 'mw-ilsearch',
-   'tabindex' = 2,
-   )
+   $fields['ilsearch'] = array(
+   'type' = 'text',
+   'name' = 'ilsearch',
+   'id' = 'mw-ilsearch',
+   'label-message' = 'listfiles_search_for',
+   'default' = $this-mSearch,
+   'size' = '40',
+   'maxlength' = '255',
);
}
-   $inputForm['username'] = Html::input( 'user', $this-mUserName, 
'text', array(
+
+   $fields['user'] = array(
+   'type' = 'text',
+   'name' = 'user',
+   'id' = 'mw-listfiles-user',
+   'label-message' = 'username',
+   'default' = $this-mUserName,
'size' = '40',
'maxlength' = '255',
-   'id' = 'mw-listfiles-user',
-   'tabindex' = 3,
-   ) );
+   );
 
-   $inputForm['listfiles-show-all'] = Html::input( 'ilshowall', 1, 
'checkbox', array(
-   'checked' = $this-mShowAll,
-   'tabindex' = 4,
-   ) );
+   $fields['ilshowall'] = array(
+   'type' = 'check',
+   'name' = 'ilshowall',
+   'id' = 'mw-listfiles-show-all',
+   'label-message' = 'listfiles-show-all',
+   'default' = $this-mShowAll,
+   );
 
-   return Html::openElement( 'form',
-   array( 'method' = 'get', 'action' = $wgScript, 'id' 
= 'mw-listfiles-form' )
-   ) .
-   Xml::fieldset( $this-msg( 'listfiles' )-text() ) .
-   Html::hidden( 'title', 
$this-getTitle()-getPrefixedText() ) .
-   Xml::buildForm( $inputForm, 'table_pager_limit_submit', 
array( 'tabindex' = 5 ) ) .
-   $this-getHiddenFields( array( 'limit', 'ilsearch', 
'user', 'title', 'ilshowall' ) ) .
-   Html::closeElement( 'fieldset' ) .
-   Html::closeElement( 'form' ) . \n;
+   $query = $this-getRequest()-getQueryValues();
+   unset( $query['title'] );
+   unset( $query['limit'] );
+   unset( $query['ilsearch'] );
+   unset( $query['user'] );
+
+   $form = new HTMLForm( $fields, $this-getContext() );
+
+   $form-setMethod( 'get' );
+   $form-setId( 'mw-listfiles-form' );
+   $form-setWrapperLegendMsg( 'listfiles' );
+   $form-setSubmitTextMsg( 'table_pager_limit_submit' );
+   $form-addHiddenFields( $query );
+
+ 

[MediaWiki-commits] [Gerrit] Update Special:ChangeEmail to use HTMLForm - change (mediawiki/core)

2014-06-29 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/142878

Change subject: Update Special:ChangeEmail to use HTMLForm
..

Update Special:ChangeEmail to use HTMLForm

Makes the code shorter and easier to read.

Change-Id: I629cee4264fad6cde98495c0e8daffe5ea245b48
---
M includes/specials/SpecialChangeEmail.php
1 file changed, 100 insertions(+), 158 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/78/142878/1

diff --git a/includes/specials/SpecialChangeEmail.php 
b/includes/specials/SpecialChangeEmail.php
index c57e33b..24c3ba2 100644
--- a/includes/specials/SpecialChangeEmail.php
+++ b/includes/specials/SpecialChangeEmail.php
@@ -26,18 +26,11 @@
  *
  * @ingroup SpecialPage
  */
-class SpecialChangeEmail extends UnlistedSpecialPage {
+class SpecialChangeEmail extends FormSpecialPage {
/**
-* Users password
-* @var string
+* @var Status
 */
-   protected $mPassword;
-
-   /**
-* Users new email address
-* @var string
-*/
-   protected $mNewEmail;
+   private $status;
 
public function __construct() {
parent::__construct( 'ChangeEmail', 'editmyprivateinfo' );
@@ -57,60 +50,102 @@
 * @param string $par
 */
function execute( $par ) {
-   global $wgAuth;
-
-   $this-setHeaders();
-   $this-outputHeader();
-
$out = $this-getOutput();
$out-disallowUserJs();
$out-addModules( 'mediawiki.special.changeemail' );
 
-   if ( !$wgAuth-allowPropChange( 'emailaddress' ) ) {
-   $this-error( 'cannotchangeemail' );
+   return parent::execute( $par );
+   }
 
-   return;
+   protected function checkExecutePermissions( User $user ) {
+   global $wgAuth;
+
+   if ( !$wgAuth-allowPropChange( 'emailaddress' ) ) {
+   throw new ErrorPageError( 'changeemail', 
'cannotchangeemail' );
}
+
+   $this-requireLogin( 'changeemail-no-info' );
+
+   // This could also let someone check the current email address, 
so
+   // require both permissions.
+   if ( !$this-getUser()-isAllowed( 'viewmyprivateinfo' ) ) {
+   throw new PermissionsError( 'viewmyprivateinfo' );
+   }
+
+   parent::checkExecutePermissions( $user );
+   }
+
+   protected function getFormFields() {
+   global $wgRequirePasswordforEmailChange;
 
$user = $this-getUser();
$request = $this-getRequest();
 
-   $this-requireLogin( 'changeemail-no-info' );
+   $oldEmailText = $user-getEmail()
+   ? $user-getEmail()
+   : $this-msg( 'changeemail-none' )-text();
 
-   if ( $request-wasPosted()  $request-getBool( 'wpCancel' ) ) 
{
+   $fields = array(
+   'Name' = array(
+   'type' = 'info',
+   'label-message' = 'username',
+   'default' = $user-getName(),
+   ),
+   'OldEmail' = array(
+   'type' = 'info',
+   'label-message' = 'changeemail-oldemail',
+   'default' = $oldEmailText,
+   ),
+   'NewEmail' = array(
+   'type' = 'email',
+   'label-message' = 'changeemail-newemail',
+   'default' = $request-getVal( 'wpNewEmail' ),
+   ),
+   );
+
+   if ( $wgRequirePasswordforEmailChange ) {
+   $fields['Password'] = array(
+   'type' = 'password',
+   'label-message' = 'changeemail-password',
+   'default' = $request-getVal( 'wpPassword' ),
+   'autofocus' = true,
+   );
+   }
+
+   return $fields;
+   }
+
+   protected function alterForm( HTMLForm $form ) {
+   $form-setId( 'mw-changeemail-form' );
+   $form-setTableId( 'mw-changeemail-table' );
+   $form-setWrapperLegendMsg( 'changeemail-header' );
+   $form-setSubmitTextMsg( 'changeemail-submit' );
+   $form-addButton( 'wpCancel',  $this-msg( 'changeemail-cancel' 
)-text() );
+   $form-addHiddenField( 'returnto', $this-getRequest()-getVal( 
'returnto' ) );
+   }
+
+   public function onSubmit( array $data ) {
+   if ( $this-getRequest()-getBool( 'wpCancel' ) ) {
+ 

[MediaWiki-commits] [Gerrit] Fix documentation of HistoryPager::lastLink() and make code ... - change (mediawiki/core)

2014-06-29 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/142899

Change subject: Fix documentation of HistoryPager::lastLink() and make code 
more readable
..

Fix documentation of HistoryPager::lastLink() and make code more readable

- Describe the possible types of $next parameter in the documentation
  rather than inline along with the possible values
- Split the big if ... elseif block into separate blocks. The elseif
  are not needed since each path returns
- Only create the revision object when really necessary

Change-Id: Ic92a6f6bd405d3f820d562a7322d34e3d9d33d17
---
M includes/actions/HistoryAction.php
1 file changed, 24 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/142899/1

diff --git a/includes/actions/HistoryAction.php 
b/includes/actions/HistoryAction.php
index f1e3c26..f9d2c68 100644
--- a/includes/actions/HistoryAction.php
+++ b/includes/actions/HistoryAction.php
@@ -776,18 +776,21 @@
/**
 * Create a diff-to-previous link for this revision for this page.
 *
-* @param Revision $prevRev The previous revision
-* @param mixed $next The newer revision
+* @param Revision $prevRev The revision being displayed
+* @param stdClass|string|null $next The next revision in list (that is
+*the previous one in chronological order).
+*May either be a row, unkown or null.
 * @return string
 */
function lastLink( $prevRev, $next ) {
$last = $this-historyPage-message['last'];
-   # $next may either be a Row, null, or unkown
-   $nextRev = is_object( $next ) ? new Revision( $next ) : $next;
-   if ( is_null( $next ) ) {
+
+   if ( $next === null ) {
# Probably no next row
return $last;
-   } elseif ( $next === 'unknown' ) {
+   }
+
+   if ( $next === 'unknown' ) {
# Next row probably exists but is unknown, use an 
oldid=prev link
return Linker::linkKnown(
$this-getTitle(),
@@ -798,21 +801,25 @@
'oldid' = 'prev'
)
);
-   } elseif ( !$prevRev-userCan( Revision::DELETED_TEXT, 
$this-getUser() )
+   }
+
+   $nextRev = new Revision( $next );
+
+   if ( !$prevRev-userCan( Revision::DELETED_TEXT, 
$this-getUser() )
|| !$nextRev-userCan( Revision::DELETED_TEXT, 
$this-getUser() )
) {
return $last;
-   } else {
-   return Linker::linkKnown(
-   $this-getTitle(),
-   $last,
-   array(),
-   array(
-   'diff' = $prevRev-getId(),
-   'oldid' = $next-rev_id
-   )
-   );
}
+
+   return Linker::linkKnown(
+   $this-getTitle(),
+   $last,
+   array(),
+   array(
+   'diff' = $prevRev-getId(),
+   'oldid' = $next-rev_id
+   )
+   );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/142899
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic92a6f6bd405d3f820d562a7322d34e3d9d33d17
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove unneeded else brach from SpecialAllMessages::execute() - change (mediawiki/core)

2014-06-28 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/142827

Change subject: Remove unneeded else brach from SpecialAllMessages::execute()
..

Remove unneeded else brach from SpecialAllMessages::execute()

Spotted while reviewing I49cf4f294a (8b4c170)

Change-Id: I5b18106bbd892a22c0d48aefecc1ae246b577480
---
M includes/specials/SpecialAllMessages.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/142827/1

diff --git a/includes/specials/SpecialAllMessages.php 
b/includes/specials/SpecialAllMessages.php
index 2b6feb4..1e4e18b 100644
--- a/includes/specials/SpecialAllMessages.php
+++ b/includes/specials/SpecialAllMessages.php
@@ -55,10 +55,9 @@
$out-addWikiMsg( 'allmessagesnotsupportedDB' );
 
return;
-   } else {
-   $this-outputHeader( 'allmessagestext' );
}
 
+   $this-outputHeader( 'allmessagestext' );
$out-addModuleStyles( 'mediawiki.special' );
 
$this-table = new AllmessagesTablePager(

-- 
To view, visit https://gerrit.wikimedia.org/r/142827
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b18106bbd892a22c0d48aefecc1ae246b577480
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Also check if 'debug_backtrace' is diabled in Maintenance::s... - change (mediawiki/core)

2014-06-25 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/142117

Change subject: Also check if 'debug_backtrace' is diabled in 
Maintenance::shouldExecute()
..

Also check if 'debug_backtrace' is diabled in Maintenance::shouldExecute()

And execute the script if $wgCommandLineMode is true. Otherwise scripts
never get executed.

Change-Id: I609d859b616905ab44a060a861be500609e5a9f0
---
M maintenance/Maintenance.php
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/142117/1

diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index e316d9e..ffb07eb 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -136,6 +136,13 @@
 * @return bool
 */
public static function shouldExecute() {
+   global $wgCommandLineMode;
+
+   if ( !function_exists( 'debug_backtrace' ) ) {
+   // If someone has a better idea...
+   return $wgCommandLineMode;
+   }
+
$bt = debug_backtrace();
$count = count( $bt );
if ( $count  2 ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/142117
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I609d859b616905ab44a060a861be500609e5a9f0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Documentation improvements in ChangeTags.php - change (mediawiki/core)

2014-06-10 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/138670

Change subject: Documentation improvements in ChangeTags.php
..

Documentation improvements in ChangeTags.php

- Variables in ChangeTags::addTags() can be null since it is
  their default value
- Make comment mark consistent

Change-Id: Icc8b2e81cf7213e6d81ce30ac0b4de57f640a638
---
M includes/ChangeTags.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/70/138670/1

diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php
index 28db8a1..f51a5a8 100644
--- a/includes/ChangeTags.php
+++ b/includes/ChangeTags.php
@@ -77,9 +77,9 @@
 * Add tags to a change given its rc_id, rev_id and/or log_id
 *
 * @param string|array $tags Tags to add to the change
-* @param int $rc_id rc_id of the change to add the tags to
-* @param int $rev_id rev_id of the change to add the tags to
-* @param int $log_id Log_id of the change to add the tags to
+* @param int|null $rc_id rc_id of the change to add the tags to
+* @param int|null $rev_id rev_id of the change to add the tags to
+* @param int|null $log_id Log_id of the change to add the tags to
 * @param string $params params to put in the ct_params field of table 
'change_tag'
 *
 * @throws MWException
@@ -143,7 +143,7 @@
'ts_log_id' = $log_id )
);
 
-   ## Update the summary row.
+   // Update the summary row.
// $prevTags can be out of date on slaves, especially when 
addTags is called consecutively,
// causing loss of tags added recently in tag_summary table.
$prevTags = $dbw-selectField( 'tag_summary', 'ts_tags', 
$tsConds, __METHOD__ );

-- 
To view, visit https://gerrit.wikimedia.org/r/138670
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc8b2e81cf7213e6d81ce30ac0b4de57f640a638
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove not-working scripts in maintenance/language - change (mediawiki/core)

2014-05-23 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/135182

Change subject: Remove not-working scripts in maintenance/language
..

Remove not-working scripts in maintenance/language

Change-Id: Idd6b1d5dc93a5bd71f0ad7445ce2f6ddc4beeb33
---
D maintenance/language/countMessages.php
D maintenance/language/validate.php
2 files changed, 0 insertions(+), 137 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/82/135182/1

diff --git a/maintenance/language/countMessages.php 
b/maintenance/language/countMessages.php
deleted file mode 100644
index 1cb24ab..000
--- a/maintenance/language/countMessages.php
+++ /dev/null
@@ -1,72 +0,0 @@
-?php
-/**
- * Count how many messages we have defined for each language.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup MaintenanceLanguage
- */
-
-require_once __DIR__ . '/../Maintenance.php';
-
-/**
- * Maintenance script that counts how many messages we have defined
- * for each language.
- *
- * @ingroup MaintenanceLanguage
- */
-class CountMessages extends Maintenance {
-   public function __construct() {
-   parent::__construct();
-   $this-mDescription = Count how many messages we have defined 
for each language;
-   }
-
-   public function execute() {
-   global $IP;
-   $dir = $this-getArg( 0, $IP/languages/messages );
-   $total = 0;
-   $nonZero = 0;
-   foreach ( glob( $dir/*.php ) as $file ) {
-   $baseName = basename( $file );
-   if ( !preg_match( '/Messages([A-Z][a-z_]+)\.php$/', 
$baseName, $m ) ) {
-   continue;
-   }
-
-   $numMessages = $this-getNumMessages( $file );
-   // print $code: $numMessages\n;
-   $total += $numMessages;
-   if ( $numMessages  0 ) {
-   $nonZero++;
-   }
-   }
-   $this-output( \nTotal: $total\n );
-   $this-output( Languages: $nonZero\n );
-   }
-
-   private function getNumMessages( $file ) {
-   // Separate function to limit scope
-   require $file;
-   if ( isset( $messages ) ) {
-   return count( $messages );
-   } else {
-   return 0;
-   }
-   }
-}
-
-$maintClass = CountMessages;
-require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/validate.php 
b/maintenance/language/validate.php
deleted file mode 100644
index f1b4079..000
--- a/maintenance/language/validate.php
+++ /dev/null
@@ -1,65 +0,0 @@
-?php
-/**
- * Check language files for unrecognised variables.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup MaintenanceLanguage
- */
-
-if ( PHP_SAPI != 'cli' ) {
-   die( Run me from the command line please.\n );
-}
-
-if ( !isset( $argv[1] ) ) {
-   print Usage: php {$argv[0]} filename\n;
-   exit( 1 );
-}
-array_shift( $argv );
-
-define( 'MEDIAWIKI', 1 );
-define( 'NOT_REALLY_MEDIAWIKI', 1 );
-
-$IP = __DIR__ . '/../..';
-
-require_once $IP/includes/Defines.php;
-require_once $IP/languages/Language.php;
-
-$files = array();
-foreach ( $argv as $arg ) {
-   $files = array_merge( $files, glob( $arg ) );
-}
-
-foreach ( $files as 

[MediaWiki-commits] [Gerrit] Don't use isset() to check for null - change (mediawiki/core)

2014-05-23 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/135184

Change subject: Don't use isset() to check for null
..

Don't use isset() to check for null

Fixes in includes/specials

Change-Id: I6c382aeaa92372bc11220694c479006e3c658362
---
M includes/specials/SpecialAllpages.php
M includes/specials/SpecialChangePassword.php
M includes/specials/SpecialFileDuplicateSearch.php
M includes/specials/SpecialLinkSearch.php
M includes/specials/SpecialPrefixindex.php
M includes/specials/SpecialWhatlinkshere.php
6 files changed, 9 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/135184/1

diff --git a/includes/specials/SpecialAllpages.php 
b/includes/specials/SpecialAllpages.php
index ad92298..0490d82 100644
--- a/includes/specials/SpecialAllpages.php
+++ b/includes/specials/SpecialAllpages.php
@@ -296,7 +296,7 @@
$bottomLinks = array();
 
# Do we put a previous link ?
-   if ( isset( $prevTitle )  $pt = $prevTitle-getText() ) {
+   if ( $prevTitle  $pt = $prevTitle-getText() ) {
$query = array( 'from' = $prevTitle-getText() );
 
if ( $namespace ) {
diff --git a/includes/specials/SpecialChangePassword.php 
b/includes/specials/SpecialChangePassword.php
index f4ce882..dcd2443 100644
--- a/includes/specials/SpecialChangePassword.php
+++ b/includes/specials/SpecialChangePassword.php
@@ -83,7 +83,7 @@
$request = $this-getRequest();
 
$oldpassMsg = $this-mOldPassMsg;
-   if ( !isset( $oldpassMsg ) ) {
+   if ( $oldpassMsg === null ) {
$oldpassMsg = $user-isLoggedIn() ? 'oldpassword' : 
'resetpass-temp-password';
}
 
diff --git a/includes/specials/SpecialFileDuplicateSearch.php 
b/includes/specials/SpecialFileDuplicateSearch.php
index 9cf5a73..b6c9d55 100644
--- a/includes/specials/SpecialFileDuplicateSearch.php
+++ b/includes/specials/SpecialFileDuplicateSearch.php
@@ -101,7 +101,7 @@
$this-setHeaders();
$this-outputHeader();
 
-   $this-filename = isset( $par ) ? $par : 
$this-getRequest()-getText( 'filename' );
+   $this-filename = $par !== null ? $par : 
$this-getRequest()-getText( 'filename' );
$this-file = null;
$this-hash = '';
$title = Title::newFromText( $this-filename, NS_FILE );
diff --git a/includes/specials/SpecialLinkSearch.php 
b/includes/specials/SpecialLinkSearch.php
index c44e8e1..b88e196 100644
--- a/includes/specials/SpecialLinkSearch.php
+++ b/includes/specials/SpecialLinkSearch.php
@@ -209,7 +209,7 @@
global $wgMiserMode;
$params = array();
$params['target'] = $this-mProt . $this-mQuery;
-   if ( isset( $this-mNs )  !$wgMiserMode ) {
+   if ( $this-mNs !== null  !$wgMiserMode ) {
$params['namespace'] = $this-mNs;
}
 
@@ -244,7 +244,7 @@
'options' = array( 'USE INDEX' = $clause )
);
 
-   if ( isset( $this-mNs )  !$wgMiserMode ) {
+   if ( $this-mNs !== null  !$wgMiserMode ) {
$retval['conds']['page_namespace'] = $this-mNs;
}
 
diff --git a/includes/specials/SpecialPrefixindex.php 
b/includes/specials/SpecialPrefixindex.php
index b6b60d4..34e803d 100644
--- a/includes/specials/SpecialPrefixindex.php
+++ b/includes/specials/SpecialPrefixindex.php
@@ -76,7 +76,7 @@
);
 
$showme = '';
-   if ( isset( $par ) ) {
+   if ( $par !== null ) {
$showme = $par;
} elseif ( $prefix != '' ) {
$showme = $prefix;
@@ -167,6 +167,7 @@
$fromList = $this-getNamespaceKeyAndText( $namespace, $from );
$prefixList = $this-getNamespaceKeyAndText( $namespace, 
$prefix );
$namespaces = $wgContLang-getNamespaces();
+   $res = null;
 
if ( !$prefixList || !$fromList ) {
$out = $this-msg( 'allpagesbadtitle' )-parseAsBlock();
@@ -261,9 +262,7 @@
'/td
td id=mw-prefixindex-nav-form 
class=mw-prefixindex-nav';
 
-   if ( isset( $res )  $res  ( $n == $this-maxPerPage 
) 
-   ( $s = $res-fetchObject() )
-   ) {
+   if ( $res  ( $n == $this-maxPerPage )  ( $s = 
$res-fetchObject() ) ) {
$query = array(
'from' = $s-page_title,
'prefix' = $prefix,
diff --git a/includes/specials/SpecialWhatlinkshere.php 

[MediaWiki-commits] [Gerrit] Remove unused variables from SpecialAllpages::showToplevel() - change (mediawiki/core)

2014-05-14 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/133209

Change subject: Remove unused variables from SpecialAllpages::showToplevel()
..

Remove unused variables from SpecialAllpages::showToplevel()

Follow-up If750cad676 (71fe7c5)

Change-Id: I95bf953b0eb742e94ddff1b6adf6d784fb5dc87c
---
M includes/specials/SpecialAllpages.php
1 file changed, 0 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/133209/1

diff --git a/includes/specials/SpecialAllpages.php 
b/includes/specials/SpecialAllpages.php
index e4fc54b..ad92298 100644
--- a/includes/specials/SpecialAllpages.php
+++ b/includes/specials/SpecialAllpages.php
@@ -156,31 +156,10 @@
 * @param bool $hideredirects Dont show redirects (default false)
 */
function showToplevel( $namespace = NS_MAIN, $from = '', $to = '', 
$hideredirects = false ) {
-   $output = $this-getOutput();
-
-   # TODO: Either make this *much* faster or cache the title index 
points
-   # in the querycache table.
-
-   $dbr = wfGetDB( DB_SLAVE );
-   $out = ;
-   $where = array( 'page_namespace' = $namespace );
-
-   if ( $hideredirects ) {
-   $where['page_is_redirect'] = 0;
-   }
-
$from = Title::makeTitleSafe( $namespace, $from );
$to = Title::makeTitleSafe( $namespace, $to );
$from = ( $from  $from-isLocal() ) ? $from-getDBkey() : 
null;
$to = ( $to  $to-isLocal() ) ? $to-getDBkey() : null;
-
-   if ( isset( $from ) ) {
-   $where[] = 'page_title = ' . $dbr-addQuotes( $from );
-   }
-
-   if ( isset( $to ) ) {
-   $where[] = 'page_title = ' . $dbr-addQuotes( $to );
-   }
 
$this-showChunk( $namespace, $from, $to, $hideredirects );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/133209
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95bf953b0eb742e94ddff1b6adf6d784fb5dc87c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Improve a bit the code of SpecialAllpages::showChunk() - change (mediawiki/core)

2014-05-13 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/133103

Change subject: Improve a bit the code of SpecialAllpages::showChunk()
..

Improve a bit the code of SpecialAllpages::showChunk()

- Early return when including the page, makes one indentation
  level less for the rest of the method
- Directly put top and bottom links in an array, so that it is
  easier to see where they are going to be displayed
- Group the HTML generation for the top form at the end of the
  method again for better readability

Change-Id: I70c174a4c6363b2303cb5110782c5a3375640f2d
---
M includes/specials/SpecialAllpages.php
1 file changed, 104 insertions(+), 105 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/133103/1

diff --git a/includes/specials/SpecialAllpages.php 
b/includes/specials/SpecialAllpages.php
index 11425e9..e4fc54b 100644
--- a/includes/specials/SpecialAllpages.php
+++ b/includes/specials/SpecialAllpages.php
@@ -267,118 +267,117 @@
}
 
if ( $this-including() ) {
-   $out2 = '';
-   } else {
-   if ( $from == '' ) {
-   // First chunk; no previous link.
-   $prevTitle = null;
-   } else {
-   # Get the last title from previous chunk
-   $dbr = wfGetDB( DB_SLAVE );
-   $res_prev = $dbr-select(
-   'page',
-   'page_title',
-   array( 'page_namespace' = $namespace, 
'page_title  ' . $dbr-addQuotes( $from ) ),
-   __METHOD__,
-   array( 'ORDER BY' = 'page_title DESC',
-   'LIMIT' = $this-maxPerPage, 
'OFFSET' = ( $this-maxPerPage - 1 )
-   )
-   );
-
-   # Get first title of previous complete chunk
-   if ( $dbr-numrows( $res_prev ) = 
$this-maxPerPage ) {
-   $pt = $dbr-fetchObject( $res_prev );
-   $prevTitle = Title::makeTitle( 
$namespace, $pt-page_title );
-   } else {
-   # The previous chunk is not complete, 
need to link to the very first title
-   # available in the database
-   $options = array( 'LIMIT' = 1 );
-   if ( !$dbr-implicitOrderby() ) {
-   $options['ORDER BY'] = 
'page_title';
-   }
-   $reallyFirstPage_title = 
$dbr-selectField( 'page', 'page_title',
-   array( 'page_namespace' = 
$namespace ), __METHOD__, $options );
-   # Show the previous link if it s not 
the current requested chunk
-   if ( $from != $reallyFirstPage_title ) {
-   $prevTitle = Title::makeTitle( 
$namespace, $reallyFirstPage_title );
-   } else {
-   $prevTitle = null;
-   }
-   }
-   }
-
-   $self = $this-getPageTitle();
-
-   $nsForm = $this-namespaceForm( $namespace, $from, $to, 
$hideredirects );
-   $out2 = Xml::openElement( 'table', array( 'class' = 
'mw-allpages-table-form' ) ) .
-   'tr
-   td' .
-   $nsForm .
-   '/td
-   td 
class=mw-allpages-nav' .
-   Linker::link( $self, $this-msg( 'allpages' 
)-escaped() );
-
-   # Do we put a previous link ?
-   if ( isset( $prevTitle )  $pt = $prevTitle-getText() 
) {
-   $query = array( 'from' = $prevTitle-getText() 
);
-
-   if ( $namespace ) {
-   $query['namespace'] = $namespace;
-   }
-
-   if ( $hideredirects ) {
-   $query['hideredirects'] = 
$hideredirects;
-   }
-
-   $prevLink = Linker::linkKnown(
-   

[MediaWiki-commits] [Gerrit] Remove messageTypes.inc and replace it by a hook - change (mediawiki/core)

2014-05-13 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/133122

Change subject: Remove messageTypes.inc and replace it by a hook
..

Remove messageTypes.inc and replace it by a hook

The list is now maintained in the translatewiki repo:
https://git.wikimedia.org/blob/translatewiki.git/HEAD/groups%2FMediaWiki%2FMediaWiki.yaml

Change-Id: I4a33b22e425cbc1eeaf8b53870ef7b7947e91b40
---
M docs/hooks.txt
M maintenance/language/languages.inc
D maintenance/language/messageTypes.inc
3 files changed, 8 insertions(+), 888 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/133122/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index 966afd8..d1507a2 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1637,6 +1637,11 @@
 $blacklist: array of checks to blacklist. See the bottom of
   maintenance/language/checkLanguage.inc for the format of this variable.
 
+'LocalisationIgnoredOptionalMessages': When fetching the list of ignored and
+optional localisation messages
+$ignored Array of ignored message keys
+$optional Array of optional message keys
+
 'LogEventsListShowLogExtract': Called before the string is added to OutputPage.
 Returning false will prevent the string from being added to the OutputPage.
 $s: html string to show for the log extract
diff --git a/maintenance/language/languages.inc 
b/maintenance/language/languages.inc
index 6e5b29d..9c9b7ff 100644
--- a/maintenance/language/languages.inc
+++ b/maintenance/language/languages.inc
@@ -61,17 +61,10 @@
/**
 * Load the list of languages: all the Messages*.php
 * files in the languages directory.
-*
-* @param bool $exif Treat the Exif messages?
 */
-   function __construct( $exif = true ) {
-   require __DIR__ . '/messageTypes.inc';
-   $this-mIgnoredMessages = $wgIgnoredMessages;
-   if ( $exif ) {
-   $this-mOptionalMessages = array_merge( 
$wgOptionalMessages );
-   } else {
-   $this-mOptionalMessages = array_merge( 
$wgOptionalMessages, $wgEXIFMessages );
-   }
+   function __construct() {
+   wfRunHooks( 'LocalisationIgnoredOptionalMessages',
+   array( $this-mIgnoredMessages, 
$this-mOptionalMessages ) );
 
$this-mLanguages = array_keys( Language::fetchLanguageNames( 
null, 'mwfile' ) );
sort( $this-mLanguages );
diff --git a/maintenance/language/messageTypes.inc 
b/maintenance/language/messageTypes.inc
deleted file mode 100644
index 10a3745..000
--- a/maintenance/language/messageTypes.inc
+++ /dev/null
@@ -1,878 +0,0 @@
-?php
-/**
- * Several types of messages.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup MaintenanceLanguage
- */
-
-/** Ignored messages, which should exist only in the English messages file. */
-$wgIgnoredMessages = array(
-   'sidebar',
-   'accesskey-pt-userpage',
-   'accesskey-pt-anonuserpage',
-   'accesskey-pt-mytalk',
-   'accesskey-pt-anontalk',
-   'accesskey-pt-preferences',
-   'accesskey-pt-watchlist',
-   'accesskey-pt-mycontris',
-   'accesskey-pt-login',
-   'accesskey-pt-logout',
-   'accesskey-ca-talk',
-   'accesskey-ca-edit',
-   'accesskey-ca-addsection',
-   'accesskey-ca-viewsource',
-   'accesskey-ca-history',
-   'accesskey-ca-protect',
-   'accesskey-ca-unprotect',
-   'accesskey-ca-delete',
-   'accesskey-ca-undelete',
-   'accesskey-ca-move',
-   'accesskey-ca-watch',
-   'accesskey-ca-unwatch',
-   'accesskey-search',
-   'accesskey-search-go',
-   'accesskey-search-fulltext',
-   'accesskey-p-logo',
-   'accesskey-n-mainpage',
-   'accesskey-n-mainpage-description',
-   'accesskey-n-portal',
-   'accesskey-n-currentevents',
-   'accesskey-n-recentchanges',
-   'accesskey-n-randompage',
-   'accesskey-n-help',
-   'accesskey-t-whatlinkshere',
-   'accesskey-t-recentchangeslinked',
-   'accesskey-feed-rss',
-   'accesskey-feed-atom',
-   'accesskey-t-contributions',
-   

[MediaWiki-commits] [Gerrit] Don't use $this for docuementing hook parameters - change (mediawiki/core)

2014-05-11 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132789

Change subject: Don't use $this for docuementing hook parameters
..

Don't use $this for docuementing hook parameters

It is a reserved keyword, so this only confuses people.

Change-Id: I6553bd93ac6f72be42493a0c3ca59c63d4a97e18
---
M docs/hooks.txt
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/132789/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index 626ca5e..966afd8 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -281,7 +281,7 @@
 'SendWatchlistEmailNotification': Return true to send watchlist email 
notification
 $targetUser: the user whom to send watchlist email notification
 $title: the page title
-$this: EmailNotification object
+$enotif: EmailNotification object
 
 'AbortChangePassword': Return false to cancel password change.
 $user: the User object to which the password change is occuring
@@ -2616,7 +2616,7 @@
 $whitelisted: Boolean value of whether this title is whitelisted
 
 'TitleSquidURLs': Called to determine which URLs to purge from HTTP caches.
-$this: Title object to purge
+$title: Title object to purge
 $urls: An array of URLs to purge from the caches, to be manipulated.
 
 'UndeleteForm::showHistory': Called in UndeleteForm::showHistory, after a

-- 
To view, visit https://gerrit.wikimedia.org/r/132789
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6553bd93ac6f72be42493a0c3ca59c63d4a97e18
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Deprecate $wgSessionStarted - change (mediawiki/core)

2014-05-10 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132624

Change subject: Deprecate $wgSessionStarted
..

Deprecate $wgSessionStarted

Wrape it in a DeprecatedGlobal object to notify extensions using it

Change-Id: I5081e79e30e01c97aa0e59b106cc75e9d1ba951a
Replacement: session_id() != ''
---
M includes/Setup.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/132624/1

diff --git a/includes/Setup.php b/includes/Setup.php
index 18d1e33..430aad9 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -554,9 +554,9 @@
 if ( !defined( 'MW_NO_SESSION' )  !$wgCommandLineMode ) {
if ( $wgRequest-checkSessionCookie() || isset( 
$_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
wfSetupSession();
-   $wgSessionStarted = true;
+   $wgSessionStarted = new DeprecatedGlobal( 'wgSessionStarted', 
true, '1.24' );
} else {
-   $wgSessionStarted = false;
+   $wgSessionStarted = new DeprecatedGlobal( 'wgSessionStarted', 
false, '1.24' );
}
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/132624
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5081e79e30e01c97aa0e59b106cc75e9d1ba951a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Improve a bit Database-related documentation - change (mediawiki/core)

2014-05-10 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132625

Change subject: Improve a bit Database-related documentation
..

Improve a bit Database-related documentation

- $wgDBport is also for MSSQL
- type key of $wgDBservers is not only mysql and postgres
- Note that $wgDBssl, $wgDBcompress and $wgDebugDumpSql only
  work in certain cases and mention how to emulate them otherwise

Change-Id: Id863da8c87308d06e0070877ac0af26d03be4faf
---
M includes/DefaultSettings.php
1 file changed, 18 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/132625/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 5d35c42..a72e2fa 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -1511,7 +1511,7 @@
 $wgDBserver = 'localhost';
 
 /**
- * Database port number (for PostgreSQL)
+ * Database port number (for PostgreSQL and Microsoft SQL Server).
  */
 $wgDBport = 5432;
 
@@ -1537,11 +1537,21 @@
 
 /**
  * Whether to use SSL in DB connection.
+ *
+ * This setting is only used $wgLBFactoryConf['class'] is set to
+ * 'LBFactorySimple' and $wgDBservers is an empty array; otherwise
+ * the DBO_SSL flag must be set in the 'flags' option of the database
+ * connection to achieve the same functionality.
  */
 $wgDBssl = false;
 
 /**
  * Whether to use compression in DB connection.
+ *
+ * This setting is only used $wgLBFactoryConf['class'] is set to
+ * 'LBFactorySimple' and $wgDBservers is an empty array; otherwise
+ * the DBO_COMPRESS flag must be set in the 'flags' option of the database
+ * connection to achieve the same functionality.
  */
 $wgDBcompress = false;
 
@@ -1649,7 +1659,7 @@
  *   - dbname:  Default database name
  *   - user:DB user
  *   - password:DB password
- *   - type:mysql or postgres
+ *   - type:DB type
  *
  *   - load:Ratio of DB_SLAVE load, must be =0, the sum of all loads 
must be 0.
  *  If this is zero for any given server, no normal query 
traffic will be
@@ -4956,7 +4966,12 @@
 $wgDebugDBTransactions = false;
 
 /**
- * Write SQL queries to the debug log
+ * Write SQL queries to the debug log.
+ *
+ * This setting is only used $wgLBFactoryConf['class'] is set to
+ * 'LBFactorySimple' and $wgDBservers is an empty array; otherwise
+ * the DBO_DEBUG flag must be set in the 'flags' option of the database
+ * connection to achieve the same functionality.
  */
 $wgDebugDumpSql = false;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/132625
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id863da8c87308d06e0070877ac0af26d03be4faf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Allow to send the memory usage with UDP profiler. - change (mediawiki/core)

2014-05-10 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132643

Change subject: Allow to send the memory usage with UDP profiler.
..

Allow to send the memory usage with UDP profiler.

Mention the possibility in $wgUDPProfilerFormatString's
documentation, but do not change it to keep backward
compatibility.

Change-Id: I86f6c47927380d6e2f5cfd75aeb39d4b0cedc6b8
---
M includes/DefaultSettings.php
M includes/profiler/ProfilerSimpleUDP.php
2 files changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/43/132643/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 5d35c42..b99d3f9 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5107,9 +5107,9 @@
 
 /**
  * Format string for the UDP profiler. The UDP profiler invokes sprintf() with
- * (profile id, count, cpu, cpu_sq, real, real_sq, entry name) as arguments.
- * You can use sprintf's argument numbering/swapping capability to repeat,
- * re-order or omit fields.
+ * (profile id, count, cpu, cpu_sq, real, real_sq, entry name, memory) as
+ * arguments. You can use sprintf's argument numbering/swapping capability to
+ * repeat, re-order or omit fields.
  *
  * @see $wgStatsFormatString
  * @since 1.22
diff --git a/includes/profiler/ProfilerSimpleUDP.php 
b/includes/profiler/ProfilerSimpleUDP.php
index 22d5cd4..627b4de 100644
--- a/includes/profiler/ProfilerSimpleUDP.php
+++ b/includes/profiler/ProfilerSimpleUDP.php
@@ -58,7 +58,8 @@
continue;
}
$pfline = sprintf( $wgUDPProfilerFormatString, 
$this-getProfileID(), $pfdata['count'],
-   $pfdata['cpu'], $pfdata['cpu_sq'], 
$pfdata['real'], $pfdata['real_sq'], $entry );
+   $pfdata['cpu'], $pfdata['cpu_sq'], 
$pfdata['real'], $pfdata['real_sq'], $entry,
+   $pfdata['memory'] );
$length = strlen( $pfline );
/* printf(!-- $pfline --); */
if ( $length + $plength  1400 ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/132643
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86f6c47927380d6e2f5cfd75aeb39d4b0cedc6b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove isset() check for $wgLocalTZoffset in Language.php - change (mediawiki/core)

2014-05-10 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132646

Change subject: Remove isset() check for $wgLocalTZoffset in Language.php
..

Remove isset() check for $wgLocalTZoffset in Language.php

Do not use isset() to check for null; furthermore this variable
can no longer be null at this point now, so the check is useless.

Also remove the initial defintion of $minDiff since this was the
only case where it could be not set afterwards and fix spacing
after the comment.

Change-Id: I6e62ce1217e6e8750acb411673903fc3bde57841
---
M languages/Language.php
1 file changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/132646/1

diff --git a/languages/Language.php b/languages/Language.php
index 964cd9f..38d3af5 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -1908,12 +1908,9 @@
$data[0] = 'Offset';
}
 
-   $minDiff = 0;
if ( $data[0] == 'System' || $tz == '' ) {
-   #  Global offset in minutes.
-   if ( isset( $wgLocalTZoffset ) ) {
-   $minDiff = $wgLocalTZoffset;
-   }
+   # Global offset in minutes.
+   $minDiff = $wgLocalTZoffset;
} elseif ( $data[0] == 'Offset' ) {
$minDiff = intval( $data[1] );
} else {

-- 
To view, visit https://gerrit.wikimedia.org/r/132646
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e62ce1217e6e8750acb411673903fc3bde57841
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove useless variable from Title::newFromText() - change (mediawiki/core)

2014-05-10 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132648

Change subject: Remove useless variable from Title::newFromText()
..

Remove useless variable from Title::newFromText()

Instead of setting and returning it directly, we
might as well return null directly...

Change-Id: Icbde20fe0f6a064dd58018d6543b03def7203a84
---
M includes/Title.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/132648/1

diff --git a/includes/Title.php b/includes/Title.php
index b9451be..3933ba0 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -218,8 +218,7 @@
}
return $t;
} else {
-   $ret = null;
-   return $ret;
+   return null;
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/132648
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbde20fe0f6a064dd58018d6543b03def7203a84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Don't use isset() to check for null - change (mediawiki/core)

2014-05-10 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132664

Change subject: Don't use isset() to check for null
..

Don't use isset() to check for null

Fixes in maintenance/

Change-Id: I300a2a0cb240cb3f9c1d0c76d4575f93e9706b59
---
M maintenance/dumpLinks.php
M maintenance/fixDoubleRedirects.php
M maintenance/generateSitemap.php
3 files changed, 7 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/132664/1

diff --git a/maintenance/dumpLinks.php b/maintenance/dumpLinks.php
index dfd1959..888c2dc 100644
--- a/maintenance/dumpLinks.php
+++ b/maintenance/dumpLinks.php
@@ -59,7 +59,7 @@
$lastPage = null;
foreach ( $result as $row ) {
if ( $lastPage != $row-page_id ) {
-   if ( isset( $lastPage ) ) {
+   if ( $lastPage !== null ) {
$this-output( \n );
}
$page = Title::makeTitle( $row-page_namespace, 
$row-page_title );
@@ -69,7 +69,7 @@
$link = Title::makeTitle( $row-pl_namespace, 
$row-pl_title );
$this-output(   . $link-getPrefixedURL() );
}
-   if ( isset( $lastPage ) ) {
+   if ( $lastPage !== null ) {
$this-output( \n );
}
}
diff --git a/maintenance/fixDoubleRedirects.php 
b/maintenance/fixDoubleRedirects.php
index 0b3cdba..a678a92 100644
--- a/maintenance/fixDoubleRedirects.php
+++ b/maintenance/fixDoubleRedirects.php
@@ -44,13 +44,14 @@
public function execute() {
$async = $this-getOption( 'async', false );
$dryrun = $this-getOption( 'dry-run', false );
-   $title = $this-getOption( 'title' );
 
-   if ( isset( $title ) ) {
-   $title = Title::newFromText( $title );
+   if ( $this-hasOption( 'title' ) ) {
+   $title = Title::newFromText( $this-getOption( 'title' 
) );
if ( !$title || !$title-isRedirect() ) {
$this-error( $title-getPrefixedText() .  is 
not a redirect!\n, true );
}
+   } else {
+   $title = null;
}
 
$dbr = wfGetDB( DB_SLAVE );
@@ -75,7 +76,7 @@
'pb.page_is_redirect' = 1,
);
 
-   if ( isset( $title ) ) {
+   if ( $title != null ) {
$conds['pb.page_namespace'] = $title-getNamespace();
$conds['pb.page_title'] = $title-getDBkey();
}
diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php
index c43851e..1930a22 100644
--- a/maintenance/generateSitemap.php
+++ b/maintenance/generateSitemap.php
@@ -244,9 +244,6 @@
 * @return null|string
 */
private static function init_path( $fspath ) {
-   if ( !isset( $fspath ) ) {
-   return null;
-   }
# Create directory if needed
if ( $fspath  !is_dir( $fspath ) ) {
wfMkdirParents( $fspath, null, __METHOD__ ) or die( 
Can not create directory $fspath.\n );

-- 
To view, visit https://gerrit.wikimedia.org/r/132664
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I300a2a0cb240cb3f9c1d0c76d4575f93e9706b59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] One more bump for 1.24 - change (mediawiki/core)

2014-04-14 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125766

Change subject: One more bump for 1.24
..

One more bump for 1.24

But this one is 1.22 - 1.23!

Change-Id: I6acf7d8ecde6ef3cf8957bc5ac63ce5c979531e8
---
M RELEASE-NOTES-1.24
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/125766/1

diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24
index 3f4c617..00dac2e 100644
--- a/RELEASE-NOTES-1.24
+++ b/RELEASE-NOTES-1.24
@@ -42,7 +42,7 @@
 
 == Upgrading ==
 
-1.24 has several database changes since 1.22, and will not work without schema
+1.24 has several database changes since 1.23, and will not work without schema
 updates. Note that due to changes to some very large tables like the revision
 table, the schema update may take quite long (minutes on a medium sized site,
 many hours on a large site).

-- 
To view, visit https://gerrit.wikimedia.org/r/125766
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6acf7d8ecde6ef3cf8957bc5ac63ce5c979531e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make profiling to UDP work again - change (mediawiki/core)

2014-04-14 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125770

Change subject: Make profiling to UDP work again
..

Make profiling to UDP work again

Fix for I1260bab2b5 (afa6af0).

Since $this-mCollated['-total'] is normally always defined,
this would cause no logging to UDP at all.

Change-Id: Ibce1c8662b4b3e99e77723f5377dd654b4f59be1
---
M includes/profiler/ProfilerSimpleUDP.php
1 file changed, 0 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/70/125770/1

diff --git a/includes/profiler/ProfilerSimpleUDP.php 
b/includes/profiler/ProfilerSimpleUDP.php
index e9bcff6..dfe923d 100644
--- a/includes/profiler/ProfilerSimpleUDP.php
+++ b/includes/profiler/ProfilerSimpleUDP.php
@@ -41,11 +41,6 @@
 
$this-close();
 
-   if ( isset( $this-mCollated['-total'] ) ) {
-   # Less than minimum, ignore
-   return;
-   }
-
if ( !function_exists( 'socket_create' ) ) {
# Sockets are not enabled
return;

-- 
To view, visit https://gerrit.wikimedia.org/r/125770
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibce1c8662b4b3e99e77723f5377dd654b4f59be1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Normalise comments in Setup.php - change (mediawiki/core)

2014-04-13 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125677

Change subject: Normalise comments in Setup.php
..

Normalise comments in Setup.php

- Changed # to // for non-block comments
- Put the inline comment describing the file back
  in the file description

Change-Id: I0aec0f4c10def58b608a8f08455fccb2317e4538
---
M includes/Setup.php
1 file changed, 36 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/77/125677/1

diff --git a/includes/Setup.php b/includes/Setup.php
index 20c6021..b155f90 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -1,6 +1,10 @@
 ?php
 /**
- * Include most things that's need to customize the site.
+ * Include most things that are needed to make %MediaWiki work.
+ *
+ * This file is included by WebStart.php and doMaintenance.php so that both
+ * web and maintenance scripts share a final set up phase to include necessary
+ * files and create global object variables.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,12 +31,6 @@
 if ( !defined( 'MEDIAWIKI' ) ) {
exit( 1 );
 }
-
-# The main wiki script and things like database
-# conversion and maintenance scripts all share a
-# common setup of including lots of classes and
-# setting up a few globals.
-#
 
 $fname = 'Setup.php';
 wfProfileIn( $fname );
@@ -61,8 +59,8 @@
 }
 
 if ( !empty( $wgActionPaths )  !isset( $wgActionPaths['view'] ) ) {
-   # 'view' is assumed the default action path everywhere in the code
-   # but is rarely filled in $wgActionPaths
+   // 'view' is assumed the default action path everywhere in the code
+   // but is rarely filled in $wgActionPaths
$wgActionPaths['view'] = $wgArticlePath;
 }
 
@@ -249,9 +247,9 @@
 unset( $repo ); // no global pollution; destroy reference
 
 if ( $wgRCFilterByAge ) {
-   # # Trim down $wgRCLinkDays so that it only lists links which are valid
-   # # as determined by $wgRCMaxAge.
-   # # Note that we allow 1 link higher than the max for things like 56 
days but a 60 day link.
+   // Trim down $wgRCLinkDays so that it only lists links which are valid
+   // as determined by $wgRCMaxAge.
+   // Note that we allow 1 link higher than the max for things like 56 
days but a 60 day link.
sort( $wgRCLinkDays );
for ( $i = 0; $i  count( $wgRCLinkDays ); $i++ ) {
if ( $wgRCLinkDays[$i] = $wgRCMaxAge / ( 3600 * 24 ) ) {
@@ -269,7 +267,7 @@
array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
 }
 
-# Set default shared prefix
+// Set default shared prefix
 if ( $wgSharedPrefix === false ) {
$wgSharedPrefix = $wgDBprefix;
 }
@@ -328,31 +326,31 @@
$wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + 
$wgExtraNamespaces;
 }
 
-# These are now the same, always
-# To determine the user language, use $wgLang-getCode()
+// These are now the same, always
+// To determine the user language, use $wgLang-getCode()
 $wgContLanguageCode = $wgLanguageCode;
 
-# Easy to forget to falsify $wgShowIPinHeader for static caches.
-# If file cache or squid cache is on, just disable this (DWIMD).
-# Do the same for $wgDebugToolbar.
+// Easy to forget to falsify $wgShowIPinHeader for static caches.
+// If file cache or squid cache is on, just disable this (DWIMD).
+// Do the same for $wgDebugToolbar.
 if ( $wgUseFileCache || $wgUseSquid ) {
$wgShowIPinHeader = false;
$wgDebugToolbar = false;
 }
 
-# Doesn't make sense to have if disabled.
+// Doesn't make sense to have if disabled.
 if ( !$wgEnotifMinorEdits ) {
$wgHiddenPrefs[] = 'enotifminoredits';
 }
 
-# We always output HTML5 since 1.22, overriding these is no longer supported
-# we set them here for extensions that depend on its value.
+// We always output HTML5 since 1.22, overriding these is no longer supported
+// we set them here for extensions that depend on its value.
 $wgHtml5 = true;
 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
 $wgJsMimeType = 'text/javascript';
 
 if ( !$wgHtml5Version  $wgAllowRdfaAttributes ) {
-   # see http://www.w3.org/TR/rdfa-in-html/#document-conformance
+   // see http://www.w3.org/TR/rdfa-in-html/#document-conformance
if ( $wgMimeType == 'application/xhtml+xml' ) {
$wgHtml5Version = 'XHTML+RDFa 1.0';
} else {
@@ -360,7 +358,7 @@
}
 }
 
-# Blacklisted file extensions shouldn't appear on the allowed list
+// Blacklisted file extensions shouldn't appear on the allowed list
 $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, 
$wgFileBlacklist ) );
 
 if ( $wgArticleCountMethod === null ) {
@@ -372,7 +370,7 @@
 }
 
 if ( $wgNewUserLog ) {
-   # Add a new log type
+   // Add a new log type
$wgLogTypes[] = 'newusers';

[MediaWiki-commits] [Gerrit] Improve UDP logging code - change (mediawiki/core)

2014-04-11 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125436

Change subject: Improve UDP logging code
..

Improve UDP logging code

- Use stream_socket_client() instead of socket_create()
  for the UDP socket in wfErrorLog(); the former is part
  of the PHP's standard extension, which, as its name
  does (not) imply, is always available whereas the latter
  is part of an optional extension.
- Split messages in chuncks of 1400 bytes in wfErrorLog(),
  so that they fit well in ethernet frames, and ensure that
  each line is part of one single packet to not confuse UDP
  logging programs
- Use wfErrorLog() in StatCounter and profilers to not have
  same code duplicated multiple times
- Add a note that $wgUDPProfilerHost now accepts IPv6
  addresses if enclosed in squre brackets

Change-Id: Idefed0946a237c6c0885464d5fa1009eb591faac
---
M includes/DefaultSettings.php
M includes/GlobalFunctions.php
M includes/StatCounter.php
M includes/profiler/ProfilerMwprof.php
M includes/profiler/ProfilerSimpleUDP.php
5 files changed, 58 insertions(+), 100 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/125436/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 8b8d75c..80603d8 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5117,6 +5117,9 @@
 /**
  * Host for UDP profiler.
  *
+ * Either an host name or an IP address. IPv6 addresses are accepted, but must
+ * be enclosed in square brackets (like [::1]).
+ *
  * The host should be running a daemon which can be obtained from MediaWiki
  * Git at:
  * http://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index cef19e1..54bb6b1 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1169,48 +1169,60 @@
  */
 function wfErrorLog( $text, $file ) {
if ( substr( $file, 0, 4 ) == 'udp:' ) {
-   # Needs the sockets extension
-   if ( preg_match( 
'!^(tcp|udp):(?://)?\[([0-9a-fA-F:]+)\]:(\d+)(?:/(.*))?$!', $file, $m ) ) {
+   if ( preg_match( 
'!^(tcp|udp):(?://)?(\[[0-9a-fA-F:]+\]):(\d+)(?:/(.*))?$!', $file, $m ) ) {
// IPv6 bracketed host
+   $protocol = $m[1];
$host = $m[2];
-   $port = intval( $m[3] );
+   $port = $m[3];
$prefix = isset( $m[4] ) ? $m[4] : false;
-   $domain = AF_INET6;
} elseif ( preg_match( 
'!^(tcp|udp):(?://)?([a-zA-Z0-9.-]+):(\d+)(?:/(.*))?$!', $file, $m ) ) {
+   $protocol = $m[1];
$host = $m[2];
-   if ( !IP::isIPv4( $host ) ) {
-   $host = gethostbyname( $host );
-   }
-   $port = intval( $m[3] );
+   $port = $m[3];
$prefix = isset( $m[4] ) ? $m[4] : false;
-   $domain = AF_INET;
} else {
throw new MWException( __METHOD__ . ': Invalid UDP 
specification' );
}
 
-   // Clean it up for the multiplexer
-   if ( strval( $prefix ) !== '' ) {
-   $text = preg_replace( '/^/m', $prefix . ' ', $text );
-
-   // Limit to 64KB
-   if ( strlen( $text )  65506 ) {
-   $text = substr( $text, 0, 65506 );
-   }
-
-   if ( substr( $text, -1 ) != \n ) {
-   $text .= \n;
-   }
-   } elseif ( strlen( $text )  65507 ) {
-   $text = substr( $text, 0, 65507 );
-   }
-
-   $sock = socket_create( $domain, SOCK_DGRAM, SOL_UDP );
-   if ( !$sock ) {
+   $socket = stream_socket_client( $protocol://$host:$port );
+   if ( !$socket ) {
return;
}
 
-   socket_sendto( $sock, $text, strlen( $text ), 0, $host, $port );
-   socket_close( $sock );
+   // Clean it up for the multiplexer
+   if ( $prefix !== false  $parts[1] !== '' ) {
+   $text = preg_replace( '/^/m', $prefix . ' ', $text );
+   }
+
+   if ( substr( $text, -1 ) != \n ) {
+   $text .= \n;
+   }
+
+   if ( strlen( $text ) = 1400 ) {
+   fwrite( $socket, $text );
+   } else {
+   // Remove the last item from the array since we ensured 
10 lines
+   // above that the string was ending by a new line.
+   $lines = 

[MediaWiki-commits] [Gerrit] Fix spelling: occurred - change (mediawiki...ErrorHandler)

2014-04-08 Thread IAlex (Code Review)
IAlex has submitted this change and it was merged.

Change subject: Fix spelling: occurred
..


Fix spelling: occurred

Change-Id: I3cf77d84debc55fed9ba033e252b07f33f949e11
---
M ErrorHandler.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  IAlex: Verified; Looks good to me, approved



diff --git a/ErrorHandler.php b/ErrorHandler.php
index 2dfa0a8..fbe8a47 100644
--- a/ErrorHandler.php
+++ b/ErrorHandler.php
@@ -76,8 +76,8 @@
  *
  * @param $errType Integer: type of error
  * @param $errMsg String: error message
- * @param $errFile String: file where the error occured
- * @param $errLine Integer: line where the error occured
+ * @param $errFile String: file where the error occurred
+ * @param $errLine Integer: line where the error occurred
  * @param $errVars Array: hmm?
  */
 function efErrorHandler( $errType, $errMsg, $errFile, $errLine, $errVars ){

-- 
To view, visit https://gerrit.wikimedia.org/r/124536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3cf77d84debc55fed9ba033e252b07f33f949e11
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ErrorHandler
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove isset() check in Sanitizer::setupAttributeWhitelist() - change (mediawiki/core)

2014-04-06 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/124157

Change subject: Remove isset() check in Sanitizer::setupAttributeWhitelist()
..

Remove isset() check in Sanitizer::setupAttributeWhitelist()

Declared variables have a default value of null, so there is
no point to use isset() to check only if it has the value null.

Also changed the location of the line break to group variable
declarations.

Change-Id: Ic36fc95db86909d8b5075954a72afa479fa20d0d
---
M includes/Sanitizer.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/124157/1

diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index 245714d..9733ccd 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -1494,11 +1494,11 @@
 */
static function setupAttributeWhitelist() {
global $wgAllowRdfaAttributes, $wgAllowMicrodataAttributes;
-
static $whitelist, $staticInitialised;
+
$globalContext = implode( '-', compact( 
'wgAllowRdfaAttributes', 'wgAllowMicrodataAttributes' ) );
 
-   if ( isset( $whitelist )  $staticInitialised == 
$globalContext ) {
+   if ( $whitelist !== null  $staticInitialised == 
$globalContext ) {
return $whitelist;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/124157
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic36fc95db86909d8b5075954a72afa479fa20d0d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove obsolete settings - change (mediawiki...Configure)

2014-04-06 Thread IAlex (Code Review)
IAlex has submitted this change and it was merged.

Change subject: Remove obsolete settings
..


Remove obsolete settings

Change-Id: I583f0eb09f0deade803eac0ad9b57fe0ae413464
---
M settings/Settings-core.php
M settings/i18n/en.json
2 files changed, 2 insertions(+), 152 deletions(-)

Approvals:
  IAlex: Verified; Looks good to me, approved



diff --git a/settings/Settings-core.php b/settings/Settings-core.php
index b903ead..9375d8f 100644
--- a/settings/Settings-core.php
+++ b/settings/Settings-core.php
@@ -24,7 +24,6 @@
),
'features' = array(
'features' = array(
-   'wgUseExternalEditor' = 'bool',
'wgUniversalEditButton' = 'bool',
'wgPageShowWatchingUsers' = 'bool',
'wgEdititis' = 'bool',
@@ -38,7 +37,6 @@
'wgUseAutomaticEditSummaries' = 'bool',
'wgUseCombinedLoginLink' = 'bool',
'wgUseTagFilter' = 'bool',
-   'wgUseTrackbacks' = 'bool',
'wgCommandLineDarkBg' = 'bool',
'wgUpgradeKey' = 'text',
),
@@ -55,15 +53,12 @@
'wgAllowUserJs' = 'bool',
'wgUseSiteCss' = 'bool',
'wgUseSiteJs' = 'bool',
-   'wgHandheldStyle' = 'text',
-   'wgHandheldForIPhone' = 'bool',
'wgIncludeLegacyJavaScript' = 'bool',
'wgLegacyJavaScriptGlobals' = 'bool',
),
'resourceloader' = array(
'wgResourceBasePath' = 'text',
'wgResourceLoaderDebug' = 'bool',
-   'wgResourceLoaderInlinePrivateModules' = 'bool',
'wgResourceLoaderMaxage' = 'array',
'wgResourceLoaderMaxQueryLength' = 'int',
'wgResourceLoaderMinifierMaxLineLength' = 'int',
@@ -89,10 +84,6 @@
'wgPoolCounterConf' = 'array',
),
'test' = array(
-   'wgEnableSelenium' = 'bool',
-   'wgSeleniumConfigFile' = 'text',
-   'wgDBtestuser' = 'text',
-   'wgDBtestpassword' = 'text',
'wgEnableJavaScriptTest' = 'bool',
'wgJavaScriptTestConfig' = 'array',
),
@@ -157,7 +148,6 @@
'wgFavicon' = 'text',
'wgFooterIcons' = 'array',
'wgLoadScript' = 'text',
-   'wgRedirectScript' = 'text',
'wgScript' = 'text',
'wgScriptExtension' = 'text',
'wgScriptPath' = 'text',
@@ -210,7 +200,6 @@
'wgAntiLockFlags' = 'int',
'wgAllDBsAreLocalhost' = 'bool',
'wgDBAvgStatusPoll' = 'int',
-   'wgUseDumbLinkUpdate' = 'bool',
'wgExternalStores' = 'array',
'wgSQLMode' = 'text',
'wgAllowSchemaUpdates' = 'bool',
@@ -229,7 +218,6 @@
'wgDBmysql5' = 'bool',
'wgDBprefix' = 'text',
'wgDBTableOptions' = 'text',
-   'wgDBtransactions' = 'bool',
),
'postgres' = array(
'wgDBmwschema' = 'text',
@@ -272,7 +260,6 @@
'wgDefaultLanguageVariant' = 'text',
'wgExtraLanguageNames' = 'array',
'wgDisabledVariants' = 'array',
-   'wgBetterDirectionality' = 'bool',
'wgCanonicalLanguageLinks' = 'bool',
'wgDisableLangConversion' = 'bool',
'wgDisableTitleConversion' = 'bool',
@@ -281,7 +268,6 @@
'wgLoginLanguageSelector' = 'bool',
'wgLegacyEncoding' = 'text',
'wgTranslateNumerals' = 'bool',
-   'wgUseDynamicDates' = 'bool',
'wgAmericanDates' = 'bool',
),
'timezone' = array(
@@ -291,12 +277,8 @@
),
'output' = array(
'output' = array(
-   'wgCleanupPresentationalAttributes' = 'bool',
-   'wgEnableTooltipsAndAccesskeys' = 'bool',
'wgHtml5' = 'bool',
'wgWellFormedXml' = 'bool',
-   'wgDocType' = 'text',
-   'wgDTD' = 'text',
'wgMimeType' = 'text',
'wgXhtmlDefaultNamespace' = 'text',

[MediaWiki-commits] [Gerrit] Remove obsolete settings - change (mediawiki...Configure)

2014-04-06 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/124188

Change subject: Remove obsolete settings
..

Remove obsolete settings

Change-Id: I583f0eb09f0deade803eac0ad9b57fe0ae413464
---
M settings/Settings-core.php
M settings/i18n/en.json
2 files changed, 2 insertions(+), 152 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Configure 
refs/changes/88/124188/1

diff --git a/settings/Settings-core.php b/settings/Settings-core.php
index b903ead..9375d8f 100644
--- a/settings/Settings-core.php
+++ b/settings/Settings-core.php
@@ -24,7 +24,6 @@
),
'features' = array(
'features' = array(
-   'wgUseExternalEditor' = 'bool',
'wgUniversalEditButton' = 'bool',
'wgPageShowWatchingUsers' = 'bool',
'wgEdititis' = 'bool',
@@ -38,7 +37,6 @@
'wgUseAutomaticEditSummaries' = 'bool',
'wgUseCombinedLoginLink' = 'bool',
'wgUseTagFilter' = 'bool',
-   'wgUseTrackbacks' = 'bool',
'wgCommandLineDarkBg' = 'bool',
'wgUpgradeKey' = 'text',
),
@@ -55,15 +53,12 @@
'wgAllowUserJs' = 'bool',
'wgUseSiteCss' = 'bool',
'wgUseSiteJs' = 'bool',
-   'wgHandheldStyle' = 'text',
-   'wgHandheldForIPhone' = 'bool',
'wgIncludeLegacyJavaScript' = 'bool',
'wgLegacyJavaScriptGlobals' = 'bool',
),
'resourceloader' = array(
'wgResourceBasePath' = 'text',
'wgResourceLoaderDebug' = 'bool',
-   'wgResourceLoaderInlinePrivateModules' = 'bool',
'wgResourceLoaderMaxage' = 'array',
'wgResourceLoaderMaxQueryLength' = 'int',
'wgResourceLoaderMinifierMaxLineLength' = 'int',
@@ -89,10 +84,6 @@
'wgPoolCounterConf' = 'array',
),
'test' = array(
-   'wgEnableSelenium' = 'bool',
-   'wgSeleniumConfigFile' = 'text',
-   'wgDBtestuser' = 'text',
-   'wgDBtestpassword' = 'text',
'wgEnableJavaScriptTest' = 'bool',
'wgJavaScriptTestConfig' = 'array',
),
@@ -157,7 +148,6 @@
'wgFavicon' = 'text',
'wgFooterIcons' = 'array',
'wgLoadScript' = 'text',
-   'wgRedirectScript' = 'text',
'wgScript' = 'text',
'wgScriptExtension' = 'text',
'wgScriptPath' = 'text',
@@ -210,7 +200,6 @@
'wgAntiLockFlags' = 'int',
'wgAllDBsAreLocalhost' = 'bool',
'wgDBAvgStatusPoll' = 'int',
-   'wgUseDumbLinkUpdate' = 'bool',
'wgExternalStores' = 'array',
'wgSQLMode' = 'text',
'wgAllowSchemaUpdates' = 'bool',
@@ -229,7 +218,6 @@
'wgDBmysql5' = 'bool',
'wgDBprefix' = 'text',
'wgDBTableOptions' = 'text',
-   'wgDBtransactions' = 'bool',
),
'postgres' = array(
'wgDBmwschema' = 'text',
@@ -272,7 +260,6 @@
'wgDefaultLanguageVariant' = 'text',
'wgExtraLanguageNames' = 'array',
'wgDisabledVariants' = 'array',
-   'wgBetterDirectionality' = 'bool',
'wgCanonicalLanguageLinks' = 'bool',
'wgDisableLangConversion' = 'bool',
'wgDisableTitleConversion' = 'bool',
@@ -281,7 +268,6 @@
'wgLoginLanguageSelector' = 'bool',
'wgLegacyEncoding' = 'text',
'wgTranslateNumerals' = 'bool',
-   'wgUseDynamicDates' = 'bool',
'wgAmericanDates' = 'bool',
),
'timezone' = array(
@@ -291,12 +277,8 @@
),
'output' = array(
'output' = array(
-   'wgCleanupPresentationalAttributes' = 'bool',
-   'wgEnableTooltipsAndAccesskeys' = 'bool',
'wgHtml5' = 'bool',
'wgWellFormedXml' = 'bool',
-   'wgDocType' = 'text',
-   'wgDTD' = 'text',
'wgMimeType' = 'text',

[MediaWiki-commits] [Gerrit] Misc follow-up - change (mediawiki...Configure)

2014-04-06 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/124256

Change subject: Misc follow-up
..

Misc follow-up

- Required version is now 1.23 (SpecialPage::getPageTitle())
- Replace another call to deprecated method
- Remove one message not used anymore

Change-Id: I05978fae171d1bbc12c9a8fe2dc822286c6c520d
---
M Configure.php
M i18n/en.json
M settings/WebExtension.php
3 files changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Configure 
refs/changes/56/124256/1

diff --git a/Configure.php b/Configure.php
index 688eb7f..d6842ea 100644
--- a/Configure.php
+++ b/Configure.php
@@ -3,7 +3,7 @@
 
 /**
  * Special page to allow users to configure the wiki via a web based interface
- * Require MediaWiki version 1.17.0 or greater
+ * Require MediaWiki version 1.23.0 or greater
  *
  * @file
  * @ingroup Extensions
diff --git a/i18n/en.json b/i18n/en.json
index 59b9835..1eebb0d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -111,7 +111,6 @@
 configure-section-specialpages: Special pages,
 configure-section-recentchanges: Recent changes,
 configure-section-users: Users,
-configure-section-externalauth: External authentication,
 configure-section-feed: Feed,
 configure-section-job: Jobs,
 configure-section-search: Search,
@@ -193,4 +192,4 @@
 configure-farmer-settings: [[Special:Configure|Configure this wiki]].,
 configure-farmer-extensions: [[Special:Extensions|Configure extensions 
for this wiki]].,
 configure-farmer-extensions-list: [[Special:Extensions|List extensions 
available for this wiki]].
-}
\ No newline at end of file
+}
diff --git a/settings/WebExtension.php b/settings/WebExtension.php
index 917950f..caceef8 100644
--- a/settings/WebExtension.php
+++ b/settings/WebExtension.php
@@ -221,7 +221,7 @@
}
if ( count( $this-mExtensionsDependencies ) ) {
$warnings[] = $context-msg( 
'configure-ext-ext-dependencies',
-   $context-getLang()-listToText( 
$this-mExtensionsDependencies ), count( $this-mExtensionsDependencies ) 
)-parse();
+   $context-getLanguage()-listToText( 
$this-mExtensionsDependencies ), count( $this-mExtensionsDependencies ) 
)-parse();
}
 
if ( count( $warnings ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/124256
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05978fae171d1bbc12c9a8fe2dc822286c6c520d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Configure
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix usage of $wgDebugDumpSql - change (mediawiki/core)

2014-04-05 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/124048

Change subject: Fix usage of $wgDebugDumpSql
..

Fix usage of $wgDebugDumpSql

- In DatabaseMssql, use $this-debug() instead of $wgDebugDumpSql
  so that it takes into account the DBO_DEBUG flag
- Use the same construction to set the DBO_DEBUG flag in
  LBFactorySimple::newMainLB() as for the other flags so that
  it is easier to read the code

Change-Id: Ie775cdb3677739a97e0d64dabbf80fc685149337
---
M includes/db/DatabaseMssql.php
M includes/db/LBFactory.php
2 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/124048/1

diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 50b7158..faed996 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -164,8 +164,7 @@
 * @throws DBUnexpectedError
 */
protected function doQuery( $sql ) {
-   global $wgDebugDumpSql;
-   if ( $wgDebugDumpSql ) {
+   if ( $this-debug() ) {
wfDebug( SQL: [$sql]\n );
}
$this-offset = 0;
diff --git a/includes/db/LBFactory.php b/includes/db/LBFactory.php
index fcce870..eca9564 100644
--- a/includes/db/LBFactory.php
+++ b/includes/db/LBFactory.php
@@ -243,7 +243,10 @@
global $wgDBserver, $wgDBuser, $wgDBpassword, 
$wgDBname, $wgDBtype, $wgDebugDumpSql;
global $wgDBssl, $wgDBcompress;
 
-   $flags = ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | 
DBO_DEFAULT;
+   $flags = DBO_DEFAULT;
+   if ( $wgDebugDumpSql ) {
+   $flags |= DBO_DEBUG;
+   }
if ( $wgDBssl ) {
$flags |= DBO_SSL;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/124048
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie775cdb3677739a97e0d64dabbf80fc685149337
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Correctly order AutoLoader class definitions - change (mediawiki/core)

2014-04-05 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/124051

Change subject: Correctly order AutoLoader class definitions
..

Correctly order AutoLoader class definitions

- Group per directory
- Sort by class name for each directory

Change-Id: If4771f2868c2183f60a6321533142a1ad5cdc7cd
---
M includes/AutoLoader.php
1 file changed, 19 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/124051/1

diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index b4a97a3..52b292f 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -45,7 +45,6 @@
'CategoryPage' = 'includes/CategoryPage.php',
'CategoryViewer' = 'includes/CategoryViewer.php',
'ChangesFeed' = 'includes/ChangesFeed.php',
-   'ChangesListSpecialPage' = 
'includes/specialpage/ChangesListSpecialPage.php',
'ChangeTags' = 'includes/ChangeTags.php',
'ChannelFeed' = 'includes/Feed.php',
'Collation' = 'includes/Collation.php',
@@ -80,7 +79,6 @@
'FileDeleteForm' = 'includes/FileDeleteForm.php',
'ForkController' = 'includes/ForkController.php',
'FormOptions' = 'includes/FormOptions.php',
-   'FormSpecialPage' = 'includes/specialpage/FormSpecialPage.php',
'GitInfo' = 'includes/GitInfo.php',
'HistoryBlob' = 'includes/HistoryBlob.php',
'HistoryBlobCurStub' = 'includes/HistoryBlob.php',
@@ -120,7 +118,6 @@
'ImageQueryPage' = 'includes/ImageQueryPage.php',
'ImportStreamSource' = 'includes/Import.php',
'ImportStringSource' = 'includes/Import.php',
-   'IncludableSpecialPage' = 
'includes/specialpage/IncludableSpecialPage.php',
'IndexPager' = 'includes/Pager.php',
'Interwiki' = 'includes/interwiki/Interwiki.php',
'LCStore' = 'includes/cache/LocalisationCache.php',
@@ -168,8 +165,6 @@
'QueryPage' = 'includes/QueryPage.php',
'QuickTemplate' = 'includes/SkinTemplate.php',
'RawMessage' = 'includes/Message.php',
-   'RedirectSpecialArticle' = 
'includes/specialpage/RedirectSpecialPage.php',
-   'RedirectSpecialPage' = 'includes/specialpage/RedirectSpecialPage.php',
'ReverseChronologicalPager' = 'includes/Pager.php',
'RevisionItem' = 'includes/RevisionList.php',
'RevisionItemBase' = 'includes/RevisionList.php',
@@ -183,17 +178,6 @@
'SiteStatsInit' = 'includes/SiteStats.php',
'Skin' = 'includes/Skin.php',
'SkinTemplate' = 'includes/SkinTemplate.php',
-   'SpecialCreateAccount' = 'includes/specials/SpecialCreateAccount.php',
-   'SpecialListAdmins' = 'includes/specials/SpecialListusers.php',
-   'SpecialListBots' = 'includes/specials/SpecialListusers.php',
-   'SpecialMycontributions' = 
'includes/specials/SpecialMyRedirectPages.php',
-   'SpecialMypage' = 'includes/specials/SpecialMyRedirectPages.php',
-   'SpecialMytalk' = 'includes/specials/SpecialMyRedirectPages.php',
-   'SpecialMyuploads' = 'includes/specials/SpecialMyRedirectPages.php',
-   'SpecialAllMyUploads' = 'includes/specials/SpecialMyRedirectPages.php',
-   'SpecialPage' = 'includes/specialpage/SpecialPage.php',
-   'SpecialPageFactory' = 'includes/specialpage/SpecialPageFactory.php',
-   'SpecialRedirectToSpecial' = 
'includes/specialpage/RedirectSpecialPage.php',
'SquidPurgeClient' = 'includes/SquidPurgeClient.php',
'SquidPurgeClientPool' = 'includes/SquidPurgeClient.php',
'StatCounter' = 'includes/StatCounter.php',
@@ -210,7 +194,6 @@
'TitleArray' = 'includes/TitleArray.php',
'TitleArrayFromResult' = 'includes/TitleArrayFromResult.php',
'TitlePrefixSearch' = 'includes/PrefixSearch.php',
-   'UnlistedSpecialPage' = 'includes/specialpage/UnlistedSpecialPage.php',
'UploadSourceAdapter' = 'includes/Import.php',
'UppercaseCollation' = 'includes/Collation.php',
'User' = 'includes/User.php',
@@ -933,6 +916,17 @@
'Sites' = 'includes/site/SiteSQLStore.php',
'SiteStore' = 'includes/site/SiteStore.php',
 
+   # includes/specialpage
+   'ChangesListSpecialPage' = 
'includes/specialpage/ChangesListSpecialPage.php',
+   'FormSpecialPage' = 'includes/specialpage/FormSpecialPage.php',
+   'IncludableSpecialPage' = 
'includes/specialpage/IncludableSpecialPage.php',
+   'RedirectSpecialArticle' = 
'includes/specialpage/RedirectSpecialPage.php',
+   'RedirectSpecialPage' = 'includes/specialpage/RedirectSpecialPage.php',
+   'SpecialPage' = 'includes/specialpage/SpecialPage.php',
+   'SpecialPageFactory' = 'includes/specialpage/SpecialPageFactory.php',
+   'SpecialRedirectToSpecial' = 
'includes/specialpage/RedirectSpecialPage.php',
+   'UnlistedSpecialPage' = 'includes/specialpage/UnlistedSpecialPage.php',
+
# includes/specials

[MediaWiki-commits] [Gerrit] Disabling profiling in the debug toolbar for ProfilerSimple ... - change (mediawiki/core)

2014-04-05 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/124066

Change subject: Disabling profiling in the debug toolbar for ProfilerSimple 
(for now)
..

Disabling profiling in the debug toolbar for ProfilerSimple (for now)

Throws a fatal error when using a ProfilerSimple subclass and the
debug toolbar (the problem is that $this-mCollated doesn't have
the same format in both cases):

Warning:  Invalid argument supplied for foreach() in 
includes/profiler/Profiler.php on line 625

Fatal error:  Unsupported operand types in includes/profiler/Profiler.php on 
line 633

Change-Id: I7f2bc714396a9249193a5828c154e09f7e0b5230
---
M includes/profiler/ProfilerSimple.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/124066/1

diff --git a/includes/profiler/ProfilerSimple.php 
b/includes/profiler/ProfilerSimple.php
index 6331a30..36f4bd4 100644
--- a/includes/profiler/ProfilerSimple.php
+++ b/includes/profiler/ProfilerSimple.php
@@ -123,6 +123,12 @@
}
}
 
+   public function getRawData() {
+   // Calling the method of the parent class results in fatal 
error.
+   // @todo Implement this correctly.
+   return array();
+   }
+
public function getFunctionReport() {
/* Implement in output subclasses */
return '';

-- 
To view, visit https://gerrit.wikimedia.org/r/124066
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f2bc714396a9249193a5828c154e09f7e0b5230
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove trailing line break check from MemcachedBagOStuff::de... - change (mediawiki/core)

2014-04-05 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/124067

Change subject: Remove trailing line break check from 
MemcachedBagOStuff::debugLog()
..

Remove trailing line break check from MemcachedBagOStuff::debugLog()

wfDebugLog() already does the same, so it's unnecessary here.

Change-Id: Ia7bbbd2806fcd638861d010835c33969322d262a
---
M includes/objectcache/MemcachedBagOStuff.php
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/67/124067/1

diff --git a/includes/objectcache/MemcachedBagOStuff.php 
b/includes/objectcache/MemcachedBagOStuff.php
index 87acb53..e4bbb43 100644
--- a/includes/objectcache/MemcachedBagOStuff.php
+++ b/includes/objectcache/MemcachedBagOStuff.php
@@ -168,9 +168,6 @@
 * Send a debug message to the log
 */
protected function debugLog( $text ) {
-   if ( substr( $text, -1 ) !== \n ) {
-   $text .= \n;
-   }
wfDebugLog( 'memcached', $text );
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/124067
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7bbbd2806fcd638861d010835c33969322d262a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] fix typo in comment in Preferences.php - change (mediawiki/core)

2014-04-05 Thread IAlex (Code Review)
IAlex has submitted this change and it was merged.

Change subject: fix typo in comment in Preferences.php
..


fix typo in comment in Preferences.php

The name of the preference was spelled wrong.

Change-Id: I443d0a8fc67c89da36b5c725dd3f3513d4170357
---
M includes/Preferences.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  IAlex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Preferences.php b/includes/Preferences.php
index 2d1529d..33d9333 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -309,7 +309,7 @@
'section' = 'personal/info',
);
}
-   // Only show preferhttps if secure login is turned on
+   // Only show prefershttps if secure login is turned on
if ( $wgSecureLogin  wfCanIPUseHTTPS( 
$context-getRequest()-getIP() ) ) {
$defaultPreferences['prefershttps'] = array(
'type' = 'toggle',

-- 
To view, visit https://gerrit.wikimedia.org/r/124072
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I443d0a8fc67c89da36b5c725dd3f3513d4170357
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: IAlex coderev...@emsenhuber.ch
Gerrit-Reviewer: jenkins-bot 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix language statistics after messages have been moved to JSON - change (mediawiki/core)

2014-04-02 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/123358

Change subject: Fix language statistics after messages have been moved to JSON
..

Fix language statistics after messages have been moved to JSON

Statistics are now showing always no messages since languages.inc
does not manage to load the JSON messages.

Had to make LocalisationCache::readJSONFile() public so that it can
be used in  languages.inc; since all methods from LocalisationCache
return localisations merged with fallbacks, which is not what we
want here.

Fix for I918cfdc46c (0dd91d5).

Change-Id: Ib52287db618b9d072e847130070d165a3e7ae44b
---
M includes/cache/LocalisationCache.php
M maintenance/language/languages.inc
2 files changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/123358/1

diff --git a/includes/cache/LocalisationCache.php 
b/includes/cache/LocalisationCache.php
index 8827219..b89316b 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -539,7 +539,7 @@
 * @throws MWException if there is a syntax error in the JSON file
 * @return array with a 'messages' key, or empty array if the file 
doesn't exist
 */
-   protected function readJSONFile( $fileName ) {
+   public function readJSONFile( $fileName ) {
wfProfileIn( __METHOD__ );
 
if ( !is_readable( $fileName ) ) {
diff --git a/maintenance/language/languages.inc 
b/maintenance/language/languages.inc
index 61ee424..0483aea 100644
--- a/maintenance/language/languages.inc
+++ b/maintenance/language/languages.inc
@@ -125,12 +125,16 @@
$this-mNamespaceAliases[$code] = array();
$this-mMagicWords[$code] = array();
$this-mSpecialPageAliases[$code] = array();
+
+   $jsonfilename = Language::getJsonMessagesFileName( $code );
+   if ( file_exists( $jsonfilename ) ) {
+   $json = Language::getLocalisationCache()-readJSONFile( 
$jsonfilename );
+   $this-mRawMessages[$code] = $json['messages'];
+   }
+
$filename = Language::getMessagesFileName( $code );
if ( file_exists( $filename ) ) {
require $filename;
-   if ( isset( $messages ) ) {
-   $this-mRawMessages[$code] = $messages;
-   }
if ( isset( $fallback ) ) {
$this-mFallback[$code] = $fallback;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/123358
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib52287db618b9d072e847130070d165a3e7ae44b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Send profiled items under the correct name - change (mediawiki/core)

2014-04-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/122780

Change subject: Send profiled items under the correct name
..

Send profiled items under the correct name

Fix for Ie8481a2e13 (811a084). The -total item
was send under the name close since it's ended
by close().

Change-Id: Iad91f1d12303e5cfb92c111f79c0ce5a8187f53b
---
M includes/profiler/ProfilerSimple.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/80/122780/1

diff --git a/includes/profiler/ProfilerSimple.php 
b/includes/profiler/ProfilerSimple.php
index 7d78e36..6331a30 100644
--- a/includes/profiler/ProfilerSimple.php
+++ b/includes/profiler/ProfilerSimple.php
@@ -107,10 +107,10 @@
if ( $functionname == 'close' ) {
if ( $ofname != '-total' ) {
$message = Profile section ended by 
close(): {$ofname};
-   $functionname = $ofname;
$this-debugGroup( 'profileerror', 
$message );
$this-mCollated[$message] = 
$this-errorEntry;
}
+   $functionname = $ofname;
} elseif ( $ofname != $functionname ) {
$message = Profiling error: in({$ofname}), 
out($functionname);
$this-debugGroup( 'profileerror', $message );

-- 
To view, visit https://gerrit.wikimedia.org/r/122780
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad91f1d12303e5cfb92c111f79c0ce5a8187f53b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make the global objects documentation consistent in Setup.php - change (mediawiki/core)

2014-04-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/122875

Change subject: Make the global objects documentation consistent in Setup.php
..

Make the global objects documentation consistent in Setup.php

Change-Id: I7ba179ea2202586854194c4f20f403ed9fd60aa3
---
M includes/Setup.php
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/75/122875/1

diff --git a/includes/Setup.php b/includes/Setup.php
index 20c6021..0e435ec 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -545,12 +545,19 @@
 wfProfileOut( $fname . '-session' );
 wfProfileIn( $fname . '-globals' );
 
+/**
+ * @var $wgContLang Language
+ */
 $wgContLang = Language::factory( $wgLanguageCode );
 $wgContLang-initEncoding();
 $wgContLang-initContLang();
 
 // Now that variant lists may be available...
 $wgRequest-interpolateTitle();
+
+/**
+ * @var $wgUser User
+ */
 $wgUser = RequestContext::getMain()-getUser(); # BackCompat
 
 /**
@@ -559,7 +566,7 @@
 $wgLang = new StubUserLang;
 
 /**
- * @var OutputPage
+ * @var $wgOut OutputPage
  */
 $wgOut = RequestContext::getMain()-getOutput(); # BackCompat
 
@@ -573,7 +580,9 @@
wfRunHooks( 'AuthPluginSetup', array( $wgAuth ) );
 }
 
-# Placeholders in case of DB error
+/**
+ * @var $wgTitle Title
+ */
 $wgTitle = null;
 
 $wgDeferredUpdateList = array();

-- 
To view, visit https://gerrit.wikimedia.org/r/122875
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ba179ea2202586854194c4f20f403ed9fd60aa3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add missing line breaks to wfDebug() calls - change (mediawiki/core)

2014-03-29 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121928

Change subject: Add missing line breaks to wfDebug() calls
..

Add missing line breaks to wfDebug() calls

Also removed true as second parameter to it from CloneDatabase.php
since it is the default value of that parameter.

Change-Id: I727ebae2bd4df0e26019985ce8c7ce73381c5642
---
M includes/Collation.php
M includes/SkinTemplate.php
M includes/WikiFilePage.php
M includes/actions/Action.php
M includes/api/ApiUpload.php
M includes/cache/LocalisationCache.php
M includes/clientpool/RedisConnectionPool.php
M includes/db/CloneDatabase.php
M includes/deferred/DataUpdate.php
M includes/externalstore/ExternalStoreDB.php
M includes/filerepo/file/File.php
M includes/jobqueue/JobQueueDB.php
M includes/parser/Parser.php
M includes/specials/SpecialContributions.php
M includes/specials/SpecialUpload.php
M includes/specials/SpecialUploadStash.php
M includes/specials/SpecialUserrights.php
M languages/utils/CLDRPluralRuleEvaluator.php
18 files changed, 28 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/121928/1

diff --git a/includes/Collation.php b/includes/Collation.php
index d2a5797..987f3a7 100644
--- a/includes/Collation.php
+++ b/includes/Collation.php
@@ -470,7 +470,7 @@
$prev = $trimmedKey;
}
foreach ( $duplicatePrefixes as $badKey ) {
-   wfDebug( Removing '{$letterMap[$badKey]}' from first 
letters. );
+   wfDebug( Removing '{$letterMap[$badKey]}' from first 
letters.\n );
unset( $letterMap[$badKey] );
// This code assumes that unsetting does not change 
sort order.
}
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php
index 32f0ed3..5073913 100644
--- a/includes/SkinTemplate.php
+++ b/includes/SkinTemplate.php
@@ -1202,7 +1202,8 @@
}
 
if ( isset( $content_actions[$key] ) ) {
-   wfDebug( __METHOD__ . : Found a 
duplicate key for $key while flattening content_navigation into 
content_actions. );
+   wfDebug( __METHOD__ . : Found a 
duplicate key for $key while flattening  .
+   content_navigation into 
content_actions.\n );
continue;
}
 
diff --git a/includes/WikiFilePage.php b/includes/WikiFilePage.php
index 817f0fa..3e8a1ce 100644
--- a/includes/WikiFilePage.php
+++ b/includes/WikiFilePage.php
@@ -207,7 +207,7 @@
$file = $this-mFile;
 
if ( ! $file instanceof LocalFile ) {
-   wfDebug( __CLASS__ . '::' . __METHOD__ . ' is not 
supported for this file' );
+   wfDebug( __CLASS__ . '::' . __METHOD__ .  is not 
supported for this file\n );
return TitleArray::newFromResult( new 
FakeResultWrapper( array() ) );
}
 
diff --git a/includes/actions/Action.php b/includes/actions/Action.php
index 1180c5e..07a5c24 100644
--- a/includes/actions/Action.php
+++ b/includes/actions/Action.php
@@ -169,7 +169,7 @@
return $this-context;
} elseif ( $this-page instanceof Article ) {
// NOTE: $this-page can be a WikiPage, which does not 
have a context.
-   wfDebug( __METHOD__ . ': no context known, falling back 
to Article\'s context.' );
+   wfDebug( __METHOD__ . : no context known, falling back 
to Article's context.\n );
return $this-page-getContext();
}
 
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index c54e8ba..30f8adb 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -92,7 +92,7 @@
} elseif ( $this-mParams['async']  $this-mParams['filekey'] 
) {
// defer verification to background process
} else {
-   wfDebug( __METHOD__ . 'about to verify' );
+   wfDebug( __METHOD__ .  about to verify\n );
$this-verifyUpload();
}
 
diff --git a/includes/cache/LocalisationCache.php 
b/includes/cache/LocalisationCache.php
index c56111f..8b78e8e 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -1281,7 +1281,7 @@
try {
$this-readers[$code] = 
CdbReader::open( $fileName );
} catch ( CdbException $e ) {
-   wfDebug( __METHOD__ . : unable to open 
cdb file for reading );
+   

[MediaWiki-commits] [Gerrit] Send the localisation store debug message to the caches lo... - change (mediawiki/core)

2014-03-29 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121971

Change subject: Send the localisation store debug message to the caches log 
group
..

Send the localisation store debug message to the caches log group

Rationale is the same as for Ifb6dc2666f (96b04ce): ability to
separate it form the main log group, as it always has a predicitible
value.

Change-Id: I0ac5baf5ab8fbe4d2025ccf6439b883dc82e9d5b
---
M includes/cache/LocalisationCache.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/121971/1

diff --git a/includes/cache/LocalisationCache.php 
b/includes/cache/LocalisationCache.php
index c56111f..3c833ac 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -212,7 +212,7 @@
}
}
 
-   wfDebug( get_class( $this ) . : using store $storeClass\n );
+   wfDebugLog( 'caches', get_class( $this ) . : using store 
$storeClass );
if ( !empty( $conf['storeDirectory'] ) ) {
$storeConf['directory'] = $conf['storeDirectory'];
}

-- 
To view, visit https://gerrit.wikimedia.org/r/121971
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ac5baf5ab8fbe4d2025ccf6439b883dc82e9d5b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Send the profiler output to the 'profileoutput' log group - change (mediawiki/core)

2014-03-27 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121336

Change subject: Send the profiler output to the 'profileoutput' log group
..

Send the profiler output to the 'profileoutput' log group

And deprecate $wgProfileOnly in the same time.

This has the advantage of allowing profiler output to be separated
from the main debug log file; or even be completely disabled while
keeping the other debugging messages.

Also updated the checks in wfLogProfilingData() to detect the cases
where the output would not be sent anywhere to not execute the
last part of the method which would be useless otherwise.

Backward compatibility with installations having $wgProfileOnly
set to true is kept by moving the log file from $wgDebugLogFile
to $wgDebugLogGroups['profileoutput'] in Setup.php in that case.

Change-Id: I7b35195e527dfa7978b710126ed4599e75dab46b
---
M RELEASE-NOTES-1.23
M includes/DefaultSettings.php
M includes/GlobalFunctions.php
M includes/Setup.php
4 files changed, 26 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/121336/1

diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index 3a91223..2017a67 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -51,6 +51,8 @@
 * $wgQueryPages has been removed. Query Pages should be added to by using the
   wgQueryPages hook.
 * $wgHttpOnlyBlacklist has been removed.
+* $wgProfileOnly is now deprecated; set the log file in
+  $wgDebugLogGroups['profileoutput'] to replace it.
 
 === New features in 1.23 ===
 * ResourceLoader can utilize the Web Storage API to cache modules client-side.
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 9a85dd4..8b2738f 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5067,6 +5067,9 @@
 
 /**
  * Don't put non-profiling info into log file
+ *
+ * @deprecated since 1.23, set the log file in
+ *   $wgDebugLogGroups['profileoutput'] instead.
  */
 $wgProfileOnly = false;
 
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 3727f16..5174b32 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -921,7 +921,6 @@
  *
  * Controlling globals:
  * $wgDebugLogFile - points to the log file
- * $wgProfileOnly - if set, normal debug messages will not be recorded.
  * $wgDebugRawPage - if false, 'action=raw' hits will not result in debug 
output.
  * $wgDebugComments - if on, some debug items may appear in comments in the 
HTML output.
  *
@@ -934,7 +933,7 @@
  * - false: same as 'log'
  */
 function wfDebug( $text, $dest = 'all' ) {
-   global $wgDebugLogFile, $wgProfileOnly, $wgDebugRawPage, 
$wgDebugLogPrefix;
+   global $wgDebugLogFile, $wgDebugRawPage, $wgDebugLogPrefix;
 
if ( !$wgDebugRawPage  wfIsDebugRawPage() ) {
return;
@@ -956,7 +955,7 @@
MWDebug::debugMsg( $text );
}
 
-   if ( $wgDebugLogFile != ''  !$wgProfileOnly ) {
+   if ( $wgDebugLogFile != '' ) {
# Strip unprintables; they can switch terminal modes when 
binary data
# gets dumped, which is pretty annoying.
$text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!', ' ', 
$text );
@@ -1227,8 +1226,8 @@
  * @todo document
  */
 function wfLogProfilingData() {
-   global $wgRequestTime, $wgDebugLogFile, $wgDebugRawPage, $wgRequest;
-   global $wgProfileLimit, $wgUser;
+   global $wgRequestTime, $wgDebugLogFile, $wgDebugLogGroups, 
$wgDebugRawPage;
+   global $wgProfileLimit, $wgUser, $wgRequest;
 
StatCounter::singleton()-flush();
 
@@ -1249,7 +1248,17 @@
$profiler-logData();
 
// Check whether this should be logged in the debug file.
-   if ( $wgDebugLogFile == '' || ( !$wgDebugRawPage  wfIsDebugRawPage() 
) ) {
+   if ( isset( $wgDebugLogGroups['profileoutput'] )
+$wgDebugLogGroups['profileoutput'] === false
+   ) {
+   // Explicitely disabled
+   return;
+   }
+   if ( !isset( $wgDebugLogGroups['profileoutput'] )  $wgDebugLogFile == 
'' ) {
+   // Logging not enabled; no point going further
+   return;
+   }
+   if ( !$wgDebugRawPage  wfIsDebugRawPage() ) {
return;
}
 
@@ -1284,7 +1293,7 @@
gmdate( 'YmdHis' ), $elapsed,
urldecode( $requestUrl . $forward ) );
 
-   wfErrorLog( $log . $profiler-getOutput(), $wgDebugLogFile );
+   wfDebugLog( 'profileoutput', $log . $profiler-getOutput() );
 }
 
 /**
diff --git a/includes/Setup.php b/includes/Setup.php
index 1a7f21e..e1777b1 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -461,6 +461,11 @@
$wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
 }
 
+if ( $wgProfileOnly ) {
+   $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
+   

[MediaWiki-commits] [Gerrit] Fix path in findHooks.php script - change (mediawiki/core)

2014-03-27 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121433

Change subject: Fix path in findHooks.php script
..

Fix path in findHooks.php script

Follow-up I4c8a2b421 (9ffd4f0): include/job was renamed
to include/jobqueue.

bug: 63186
Change-Id: I47d594adbaa6d944724a32ca1c701a5bfd297205
---
M maintenance/findHooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/121433/1

diff --git a/maintenance/findHooks.php b/maintenance/findHooks.php
index 32ecb1d..6d7de09 100644
--- a/maintenance/findHooks.php
+++ b/maintenance/findHooks.php
@@ -86,7 +86,7 @@
$IP . '/includes/htmlform/',
$IP . '/includes/installer/',
$IP . '/includes/interwiki/',
-   $IP . '/includes/job/',
+   $IP . '/includes/jobqueue/',
$IP . '/includes/json/',
$IP . '/includes/logging/',
$IP . '/includes/media/',

-- 
To view, visit https://gerrit.wikimedia.org/r/121433
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47d594adbaa6d944724a32ca1c701a5bfd297205
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use {{FULLPAGENAME}} in 'missing-revision' message. - change (mediawiki/core)

2014-03-27 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121444

Change subject: Use {{FULLPAGENAME}} in 'missing-revision' message.
..

Use {{FULLPAGENAME}} in 'missing-revision' message.

Otherwise the namespace is lost if the page does not belong to the
main namespace.

Fix for Ibe60c84cfe (d24a4d7).

Change-Id: I9f8d6a593b7f55028fcd6f30184baf223b0aa2da
---
M languages/messages/MessagesEn.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/44/121444/1

diff --git a/languages/messages/MessagesEn.php 
b/languages/messages/MessagesEn.php
index 8b7b005..dbf520d 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -1464,7 +1464,7 @@
 'noarticletext-nopermission'   = 'There is currently no text in 
this page.
 You can [[Special:Search/{{PAGENAME}}|search for this page title]] in other 
pages, or span 
class=plainlinks[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE search 
the related logs]/span, but you do not have permission to create this page.',
 'noarticletextanon'= '{{int:noarticletext}}', # do 
not translate or duplicate this message to other languages
-'missing-revision' = 'The revision #$1 of the page 
named {{PAGENAME}} does not exist.
+'missing-revision' = 'The revision #$1 of the page 
named {{FULLPAGENAME}} does not exist.
 
 This is usually caused by following an outdated history link to a page that 
has been deleted.
 Details can be found in the 
[{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE deletion log].',

-- 
To view, visit https://gerrit.wikimedia.org/r/121444
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f8d6a593b7f55028fcd6f30184baf223b0aa2da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fixed bug where variables referenced where not reachable (ou... - change (mediawiki...MassEditRegex)

2014-03-27 Thread IAlex (Code Review)
IAlex has submitted this change and it was merged.

Change subject: Fixed bug where variables referenced where not reachable (out 
of scope)
..


Fixed bug where variables referenced where not reachable (out of scope)

Change-Id: I9a9f9c810a9a5da1d169c2e7d04cc2c5a59a88d7
---
M MassEditRegex.class.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  IAlex: Verified; Looks good to me, approved



diff --git a/MassEditRegex.class.php b/MassEditRegex.class.php
index 5b37136..69c70a7 100644
--- a/MassEditRegex.class.php
+++ b/MassEditRegex.class.php
@@ -319,16 +319,16 @@
$iCount = 0;
$newText = $curText;
foreach ( $this-aMatch as $i = $strMatch ) {
-   $this-strNextReplace = $this-aReplace[$i];
+   $strNextReplace = $this-aReplace[$i];
$result = @preg_replace_callback( $strMatch,
-   function ( $aMatches ) {
+   function ( $aMatches ) use($strNextReplace){
$strFind = array();
$strReplace = array();
foreach ($aMatches as $i = $strMatch) {
$aFind[] = '$' . $i;
$aReplace[] = $strMatch;
}
-   return str_replace($aFind, $aReplace, 
$this-strNextReplace);
+   return str_replace($aFind, $aReplace, 
$strNextReplace);
}, $newText, -1, $iCount );
if ($result !== null) {
$newText = $result;

-- 
To view, visit https://gerrit.wikimedia.org/r/97902
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a9f9c810a9a5da1d169c2e7d04cc2c5a59a88d7
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MassEditRegex
Gerrit-Branch: master
Gerrit-Owner: Netbrain k...@heldig.org
Gerrit-Reviewer: IAlex coderev...@emsenhuber.ch
Gerrit-Reviewer: Malvineous malvine...@shikadi.net
Gerrit-Reviewer: Netbrain k...@heldig.org
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use session_id() instead of $wgSessionStarted to check for s... - change (mediawiki...FacebookOpenGraph)

2014-03-26 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121243

Change subject: Use session_id() instead of $wgSessionStarted to check for 
session existence
..

Use session_id() instead of $wgSessionStarted to check for session existence

More reliable check and so that $wgSessionStarted can be removed at some point.

Change-Id: I46444258616e7e92a11ef099a8260430b22ee520
---
M Facebook/FacebookUser.php
M Facebook/SpecialConnect.php
2 files changed, 2 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FacebookOpenGraph 
refs/changes/43/121243/1

diff --git a/Facebook/FacebookUser.php b/Facebook/FacebookUser.php
index 951cf79..b15d76a 100644
--- a/Facebook/FacebookUser.php
+++ b/Facebook/FacebookUser.php
@@ -185,8 +185,7 @@
$this-updateFromFacebook();

// Setup the session
-   global $wgSessionStarted;
-   if (!$wgSessionStarted) {
+   if ( session_id() == '' ) {
wfSetupSession();
}

diff --git a/Facebook/SpecialConnect.php b/Facebook/SpecialConnect.php
index e42ce9d..50487ef 100644
--- a/Facebook/SpecialConnect.php
+++ b/Facebook/SpecialConnect.php
@@ -184,8 +184,7 @@
global $wgUser, $wgRequest;
 
// Setup the session
-   global $wgSessionStarted;
-   if (!$wgSessionStarted) {
+   if ( session_id() == '' ) {
wfSetupSession();
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/121243
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46444258616e7e92a11ef099a8260430b22ee520
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FacebookOpenGraph
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove useless .DS_Store file - change (mediawiki...WikibaseMobile)

2014-03-26 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121245

Change subject: Remove useless .DS_Store file
..

Remove useless .DS_Store file

Change-Id: I0913f1dbc0003d56fe5b6c27181c309b2aa6f5ea
---
D assets/.DS_Store
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseMobile 
refs/changes/45/121245/1

diff --git a/assets/.DS_Store b/assets/.DS_Store
deleted file mode 100644
index 5008ddf..000
--- a/assets/.DS_Store
+++ /dev/null
Binary files differ

-- 
To view, visit https://gerrit.wikimedia.org/r/121245
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0913f1dbc0003d56fe5b6c27181c309b2aa6f5ea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseMobile
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use session_id() instead of $wgSessionStarted to check for s... - change (mediawiki...SecureSessions)

2014-03-26 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121246

Change subject: Use session_id() instead of $wgSessionStarted to check for 
session existence
..

Use session_id() instead of $wgSessionStarted to check for session existence

More reliable check and so that $wgSessionStarted can be removed at some point.

Change-Id: Ia60e49a127183796d1d9c34ef3d57916891d72c1
---
M SecureSessions.hooks.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecureSessions 
refs/changes/46/121246/1

diff --git a/SecureSessions.hooks.php b/SecureSessions.hooks.php
index f71c0a9..444880c 100644
--- a/SecureSessions.hooks.php
+++ b/SecureSessions.hooks.php
@@ -56,13 +56,13 @@
 * the necessary hooks for the extension.
 */
public static function setup() {
-   global $wgEnhancedSessionAuth, $wgSessionCycleId, 
$wgSessionStarted;
+   global $wgEnhancedSessionAuth, $wgSessionCycleId;
$request = RequestContext::getMain()-getRequest();
 
// Regenerate session ID to avoid fixation, but don't trash
// the old session immediately in case there are some 
asynchronous
// requests still using it.
-   if ( $wgSessionCycleId  $wgSessionStarted  
$request-getSessionData( 'wsExpiry' ) === null ) {
+   if ( $wgSessionCycleId  session_id() != ''  
$request-getSessionData( 'wsExpiry' ) === null ) {
// Set obsolete and expiration time.
$data = $_SESSION;
$request-setSessionData( 'wsObsolete', true );

-- 
To view, visit https://gerrit.wikimedia.org/r/121246
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia60e49a127183796d1d9c34ef3d57916891d72c1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecureSessions
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use session_id() instead of $wgSessionStarted to check for s... - change (mediawiki...SocialLogin)

2014-03-26 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/121250

Change subject: Use session_id() instead of $wgSessionStarted to check for 
session existence
..

Use session_id() instead of $wgSessionStarted to check for session existence

More reliable check and so that $wgSessionStarted can be removed at some point.

Change-Id: I6541b52d090b0ea3f17c987ed2595d086bd1c3a1
---
M SocialLogin.body.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialLogin 
refs/changes/50/121250/1

diff --git a/SocialLogin.body.php b/SocialLogin.body.php
index 1b7fc69..383f3a8 100644
--- a/SocialLogin.body.php
+++ b/SocialLogin.body.php
@@ -103,8 +103,8 @@
}
 
function onUserLoadAfterLoadFromSession( $user ) {
-   global $wgRequest, $wgOut, $wgContLang, $wgSocialLoginServices, 
$wgSocialLoginAddForms, $wgSessionStarted;
-   if (!$wgSessionStarted) {
+   global $wgRequest, $wgOut, $wgContLang, $wgSocialLoginServices, 
$wgSocialLoginAddForms;
+   if (session_id() == '') {
wfSetupSession();
}
$action = $wgRequest-getText('action', 'auth');

-- 
To view, visit https://gerrit.wikimedia.org/r/121250
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6541b52d090b0ea3f17c987ed2595d086bd1c3a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SocialLogin
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove wfDebugLog() call from wfSetupSession() - change (mediawiki/core)

2014-03-25 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/120848

Change subject: Remove wfDebugLog() call from wfSetupSession()
..

Remove wfDebugLog() call from wfSetupSession()

Since Iffba121a99 (00b7f76) with the removal of wfHttpOnlySafe(),
session cookie's parameters are based only on configuration
settings, so there is no point to spam the cookie log group
with predicitible values.

Change-Id: I8b1cdea929cefc32dd8b01c2ecbf2d76bb64189f
---
M includes/GlobalFunctions.php
1 file changed, 0 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/120848/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index f0b0a8d..2314cb2 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3513,14 +3513,6 @@
# hasn't already been set to the desired value (that causes 
errors)
ini_set( 'session.save_handler', $wgSessionHandler );
}
-   wfDebugLog( 'cookie',
-   'session_set_cookie_params: ' . implode( ', ',
-   array(
-   0,
-   $wgCookiePath,
-   $wgCookieDomain,
-   $wgCookieSecure,
-   $wgCookieHttpOnly ) ) . '' );
session_set_cookie_params(
0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, 
$wgCookieHttpOnly );
session_cache_limiter( 'private, must-revalidate' );

-- 
To view, visit https://gerrit.wikimedia.org/r/120848
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b1cdea929cefc32dd8b01c2ecbf2d76bb64189f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove unused $wgLicenseTerms - change (mediawiki/core)

2014-03-25 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/120860

Change subject: Remove unused $wgLicenseTerms
..

Remove unused $wgLicenseTerms

Follow-up I3454d605a7 (4ebd4de).

Change-Id: I1e22e24a2de686371967f3951a4c8b8c553c3f0b
---
M RELEASE-NOTES-1.23
M includes/DefaultSettings.php
2 files changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/120860/1

diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index 9633edd..1818c7c 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -51,6 +51,7 @@
 * $wgQueryPages has been removed. Query Pages should be added to by using the
   wgQueryPages hook.
 * $wgHttpOnlyBlacklist has been removed.
+* $wgLicenseTerms has been removed as it was unused.
 
 === New features in 1.23 ===
 * ResourceLoader can utilize the Web Storage API to cache modules client-side.
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 612acb9..9adf03f 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5846,11 +5846,6 @@
 $wgRightsIcon = null;
 
 /**
- * Set to an array of metadata terms. Else they will be loaded based on 
$wgRightsUrl
- */
-$wgLicenseTerms = false;
-
-/**
  * Set this to some HTML to override the rights icon with an arbitrary logo
  * @deprecated since 1.18 Use $wgFooterIcons['copyright']['copyright']
  */

-- 
To view, visit https://gerrit.wikimedia.org/r/120860
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e22e24a2de686371967f3951a4c8b8c553c3f0b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix documentation of wfDebugLog() - change (mediawiki/core)

2014-03-23 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/120354

Change subject: Fix documentation of wfDebugLog()
..

Fix documentation of wfDebugLog()

- $public parameter does not exist anymore
- Put the type before the parameter name

Change-Id: I0f3a893803ab5466570ef45398f797e4714d9d37
---
M includes/GlobalFunctions.php
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/120354/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index a6f936f..58395db 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1027,10 +1027,8 @@
  *
  * @since 1.23 support for sampling log messages via $wgDebugLogGroups.
  *
- * @param $logGroup String
- * @param $text String
- * @param bool $public whether to log the event in the public log if no private
- * log file is specified, (default true)
+ * @param string $logGroup
+ * @param string $text
  * @param string|bool $dest Destination of the message:
  * - 'all': both to the log and HTML (debug toolbar or HTML comments)
  * - 'log': only to the log and not in HTML

-- 
To view, visit https://gerrit.wikimedia.org/r/120354
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f3a893803ab5466570ef45398f797e4714d9d37
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Automatically add a new line at the end of wfLogDBError() - change (mediawiki/core)

2014-03-23 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/120355

Change subject: Automatically add a new line at the end of wfLogDBError()
..

Automatically add a new line at the end of wfLogDBError()

I found two calls to wfLogDBError() that do not add a new line
at the end of the message. So instead of adding them to that
entries, I changed wfLogDBError() to automatically put it on
icoming messages; as for wfDebugLog().

Change-Id: Id014b5827a0aeef6873ebf08d78f0a3d7581d63b
---
M includes/GlobalFunctions.php
M includes/db/Database.php
M includes/db/DatabaseMysqlBase.php
M includes/db/LoadBalancer.php
4 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/120355/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index a6f936f..981a556 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1109,7 +1109,7 @@
 
$date = $d-format( 'D M j G:i:s T Y' );
 
-   $text = $date\t$host\t$wiki\t$text;
+   $text = $date\t$host\t$wiki\t . trim( $text ) . \n;
wfErrorLog( $text, $wgDBerrorLog );
}
 }
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 91ab0ca..b811bfc 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -1109,7 +1109,7 @@
$elapsed = round( microtime( true ) - 
$wgRequestTime, 3 );
if ( $elapsed  300 ) {
# Not a database error to lose a 
transaction after a minute or two
-   wfLogDBError( Connection lost and 
reconnected after {$elapsed}s, query: $sqlx\n );
+   wfLogDBError( Connection lost and 
reconnected after {$elapsed}s, query: $sqlx );
}
if ( !$hadTrx ) {
# Should be safe to silently retry
@@ -1153,7 +1153,7 @@
$this-ignoreErrors( $ignore );
} else {
$sql1line = mb_substr( str_replace( \n, \\n, $sql 
), 0, 5 * 1024 );
-   wfLogDBError( 
$fname\t{$this-mServer}\t$errno\t$error\t$sql1line\n );
+   wfLogDBError( 
$fname\t{$this-mServer}\t$errno\t$error\t$sql1line );
wfDebug( SQL ERROR:  . $error . \n );
throw new DBQueryError( $this, $error, $errno, $sql, 
$fname );
}
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index 85be31c..7ee03e0 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -93,7 +93,7 @@
if ( !$error ) {
$error = $this-lastError();
}
-   wfLogDBError( Error connecting to {$this-mServer}: 
$error\n );
+   wfLogDBError( Error connecting to {$this-mServer}: 
$error );
wfDebug( DB connection error\n .
Server: $server, User: $user, Password:  .
substr( $password, 0, 3 ) . ..., error:  . 
$error . \n );
@@ -108,7 +108,7 @@
$success = $this-selectDB( $dbName );
wfRestoreWarnings();
if ( !$success ) {
-   wfLogDBError( Error selecting database $dbName 
on server {$this-mServer}\n );
+   wfLogDBError( Error selecting database $dbName 
on server {$this-mServer} );
wfDebug( Error selecting database $dbName on 
server {$this-mServer}  .
from client host  . wfHostname() . 
\n );
 
diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php
index de4c2f5..a1703f0 100644
--- a/includes/db/LoadBalancer.php
+++ b/includes/db/LoadBalancer.php
@@ -744,13 +744,13 @@
 
if ( !is_object( $conn ) ) {
// No last connection, probably due to all servers 
being too busy
-   wfLogDBError( LB failure with no last connection. 
Connection error: {$this-mLastError}\n );
+   wfLogDBError( LB failure with no last connection. 
Connection error: {$this-mLastError} );
 
// If all servers were busy, mLastError will contain 
something sensible
throw new DBConnectionError( null, $this-mLastError );
} else {
$server = $conn-getProperty( 'mServer' );
-   wfLogDBError( Connection error: {$this-mLastError} 
({$server})\n );
+   wfLogDBError( Connection error: {$this-mLastError} 
({$server}) );
  

[MediaWiki-commits] [Gerrit] Remove double wfDebug() call in Database.php - change (mediawiki/core)

2014-03-23 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/120360

Change subject: Remove double wfDebug() call in Database.php
..

Remove double wfDebug() call in Database.php

Fix for I12adfb4fcb (54664be).

Change-Id: I6acfd35aae18af9d6e5ae29e5554ca7d04342af5
---
M includes/db/Database.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/120360/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 91ab0ca..382cd9c 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -1097,7 +1097,6 @@
if ( false === $ret  $this-wasErrorReissuable() ) {
# Transaction is gone, like it or not
$hadTrx = $this-mTrxLevel; // possible lost transaction
-   wfDebug( Connection lost, reconnecting...\n );
$this-mTrxLevel = 0;
wfDebug( Connection lost, reconnecting...\n );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/120360
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6acfd35aae18af9d6e5ae29e5554ca7d04342af5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix profiling error in LocalisationCache::readJSONFile() - change (mediawiki/core)

2014-03-18 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/119244

Change subject: Fix profiling error in LocalisationCache::readJSONFile()
..

Fix profiling error in LocalisationCache::readJSONFile()

Follow-up I8d137e15e1 (6380e81).

Also added more blank lines for better readability.

Change-Id: Iae7921b017f81d5512e71384d7999502154c034c
---
M includes/cache/LocalisationCache.php
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/44/119244/1

diff --git a/includes/cache/LocalisationCache.php 
b/includes/cache/LocalisationCache.php
index 409160c..c56111f 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -541,18 +541,27 @@
 */
protected function readJSONFile( $fileName ) {
wfProfileIn( __METHOD__ );
+
if ( !is_readable( $fileName ) ) {
+   wfProfileOut( __METHOD__ );
+
return array();
}
 
$json = file_get_contents( $fileName );
if ( $json === false ) {
+   wfProfileOut( __METHOD__ );
+
return array();
}
+
$data = FormatJson::decode( $json, true );
if ( $data === null ) {
+   wfProfileOut( __METHOD__ );
+
throw new MWException( __METHOD__ . : Invalid JSON 
file: $fileName );
}
+
// Remove keys starting with '@', they're reserved for metadata 
and non-message data
foreach ( $data as $key = $unused ) {
if ( $key === '' || $key[0] === '@' ) {
@@ -560,6 +569,8 @@
}
}
 
+   wfProfileOut( __METHOD__ );
+
// The JSON format only supports messages, none of the other 
variables, so wrap the data
return array( 'messages' = $data );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/119244
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae7921b017f81d5512e71384d7999502154c034c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use elseif instead of else if in PHP - change (mediawiki/core)

2014-03-15 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118811

Change subject: Use elseif instead of else if in PHP
..

Use elseif instead of else if in PHP

Per https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#C_borrowings

Change-Id: I5e3a301c2f3c5ec6b965500c43d16022b8b82e59
---
M maintenance/generateJsonI18n.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/11/118811/1

diff --git a/maintenance/generateJsonI18n.php b/maintenance/generateJsonI18n.php
index 9c8354c..fd56361 100644
--- a/maintenance/generateJsonI18n.php
+++ b/maintenance/generateJsonI18n.php
@@ -65,7 +65,7 @@
$extensionStyle = false;
$langcode = $this-getOption( 'langcode' );
$messages = array( $langcode = $messages );
-   } else if ( $this-hasOption( 'langcode' ) ) {
+   } elseif ( $this-hasOption( 'langcode' ) ) {
$this-output( Warning: --langcode option set but will 
not be used.\n );
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/118811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e3a301c2f3c5ec6b965500c43d16022b8b82e59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Move variable definitions near to where they are used - change (mediawiki/core)

2014-03-15 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118813

Change subject: Move variable definitions near to where they are used
..

Move variable definitions near to where they are used

In LoadBalancer::reuseConnection(), if the condition
$serverIndex === null || $refCount === null is met,
then those variables will not be used. So only define
them when they will readlly be used.

Change-Id: Ifbd4131f40d3babe733b8723d0d29d39890bb309
---
M includes/db/LoadBalancer.php
1 file changed, 8 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/13/118813/1

diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php
index 5f880d6..de4c2f5 100644
--- a/includes/db/LoadBalancer.php
+++ b/includes/db/LoadBalancer.php
@@ -493,13 +493,6 @@
public function reuseConnection( $conn ) {
$serverIndex = $conn-getLBInfo( 'serverIndex' );
$refCount = $conn-getLBInfo( 'foreignPoolRefCount' );
-   $dbName = $conn-getDBname();
-   $prefix = $conn-tablePrefix();
-   if ( strval( $prefix ) !== '' ) {
-   $wiki = $dbName-$prefix;
-   } else {
-   $wiki = $dbName;
-   }
if ( $serverIndex === null || $refCount === null ) {
wfDebug( __METHOD__ . : this connection was not opened 
as a foreign connection\n );
 
@@ -516,6 +509,14 @@
 
return;
}
+
+   $dbName = $conn-getDBname();
+   $prefix = $conn-tablePrefix();
+   if ( strval( $prefix ) !== '' ) {
+   $wiki = $dbName-$prefix;
+   } else {
+   $wiki = $dbName;
+   }
if ( $this-mConns['foreignUsed'][$serverIndex][$wiki] !== 
$conn ) {
throw new MWException( __METHOD__ . : connection not 
found, has  .
the connection been freed already? );

-- 
To view, visit https://gerrit.wikimedia.org/r/118813
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifbd4131f40d3babe733b8723d0d29d39890bb309
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] New 'profileerror' log group for profiling errors - change (mediawiki/core)

2014-03-15 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118937

Change subject: New 'profileerror' log group for profiling errors
..

New 'profileerror' log group for profiling errors

Easier to catch them than if they are in the default debug log.

Added Profiler::debugGroup() as wrapper to wfDebugLog(), as
there already is Profiler::debug() for wfDebug(), so that
there won't be a fatal error if the error happens before the
inclusion of GlobalFunctions.php and converted other calls
to wfDebugLog() to use it.

Change-Id: Ie8481a2e13a94efa0248dd5a36b6b1a22811817e
---
M includes/profiler/Profiler.php
M includes/profiler/ProfilerMwprof.php
M includes/profiler/ProfilerSimple.php
3 files changed, 30 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/118937/1

diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php
index 235a5ad..a26ef68 100644
--- a/includes/profiler/Profiler.php
+++ b/includes/profiler/Profiler.php
@@ -227,15 +227,17 @@
$bit = array_pop( $this-mWorkStack );
 
if ( !$bit ) {
-   $this-debug( Profiling error, !\$bit: 
$functionname\n );
+   $this-debugGroup( 'profileerror', Profiling error, 
!\$bit: $functionname );
} else {
if ( $functionname == 'close' ) {
-   $message = Profile section ended by close(): 
{$bit[0]};
-   $this-debug( $message\n );
-   $this-mStack[] = array( $message, 0, 0.0, 0, 
0.0, 0 );
+   if ( $bit[0] != '-total' ) {
+   $message = Profile section ended by 
close(): {$bit[0]};
+   $this-debugGroup( 'profileerror', 
$message );
+   $this-mStack[] = array( $message, 0, 
0.0, 0, 0.0, 0 );
+   }
} elseif ( $bit[0] != $functionname ) {
$message = Profiling error: in({$bit[0]}), 
out($functionname);
-   $this-debug( $message\n );
+   $this-debugGroup( 'profileerror', $message );
$this-mStack[] = array( $message, 0, 0.0, 0, 
0.0, 0 );
}
$bit[] = $time;
@@ -324,7 +326,7 @@
list( $method, $realtime ) = $info;
$msg .= sprintf( %d\t%.6f\t%s\n, $i, 
$realtime, $method );
}
-   wfDebugLog( 'DBPerformance', $msg );
+   $this-debugGroup( 'DBPerformance', $msg );
}
unset( $this-mDBTrxHoldingLocks[$name] );
unset( $this-mDBTrxMethodTimes[$name] );
@@ -721,6 +723,18 @@
}
 
/**
+* Add an entry in the debug log group
+*
+* @param string $group Group to send the message to
+* @param string $s to output
+*/
+   function debugGroup( $group, $s ) {
+   if ( function_exists( 'wfDebugLog' ) ) {
+   wfDebugLog( $group, $s );
+   }
+   }
+
+   /**
 * Get the content type sent out to the client.
 * Used for profilers that output instead of store data.
 * @return string
diff --git a/includes/profiler/ProfilerMwprof.php 
b/includes/profiler/ProfilerMwprof.php
index e81c6ec..5ecfc21 100644
--- a/includes/profiler/ProfilerMwprof.php
+++ b/includes/profiler/ProfilerMwprof.php
@@ -90,7 +90,7 @@
// Check for unbalanced profileIn / profileOut calls.
// Bad entries are logged but not sent.
if ( $inName !== $outName ) {
-   wfDebugLog( 'ProfilerUnbalanced', json_encode( array( 
$inName, $outName ) ) );
+   $this-debugGroup( 'ProfilerUnbalanced', json_encode( 
array( $inName, $outName ) ) );
return;
}
 
diff --git a/includes/profiler/ProfilerSimple.php 
b/includes/profiler/ProfilerSimple.php
index ee92c17..7d78e36 100644
--- a/includes/profiler/ProfilerSimple.php
+++ b/includes/profiler/ProfilerSimple.php
@@ -102,17 +102,18 @@
list( $ofname, /* $ocount */, $ortime, $octime ) = array_pop( 
$this-mWorkStack );
 
if ( !$ofname ) {
-   $this-debug( Profiling error: $functionname\n );
+   $this-debugGroup( 'profileerror', Profiling error: 
$functionname );
} else {
if ( $functionname == 'close' ) {
-   $message = Profile section ended by close(): 
{$ofname};
-   

[MediaWiki-commits] [Gerrit] Link to bugs.mediawiki.org in UPGRADE for consistency - change (mediawiki/core)

2014-03-14 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118761

Change subject: Link to bugs.mediawiki.org in UPGRADE for consistency
..

Link to bugs.mediawiki.org in UPGRADE for consistency

README mentions that the bug tracker is a https://bugs.mediawiki.org/.

Change-Id: I27a97cb89ba1981c931fe5fe2ae1422c832c4405
---
M UPGRADE
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/118761/1

diff --git a/UPGRADE b/UPGRADE
index 1ff98cd..f727b4f 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -5,7 +5,7 @@
 * the documentation at https://www.mediawiki.org
 * the mediawiki-l mailing list archive at
   http://lists.wikimedia.org/pipermail/mediawiki-l/
-* the bug tracker at https://bugzilla.wikimedia.org
+* the bug tracker at https://bugs.mediawiki.org
 
 for information and workarounds to common issues.
 

-- 
To view, visit https://gerrit.wikimedia.org/r/118761
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27a97cb89ba1981c931fe5fe2ae1422c832c4405
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Put the else (or elseif) on the same line as the previou... - change (mediawiki/core)

2014-03-14 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118764

Change subject: Put the else (or elseif) on the same line as the previous 
closing brace
..

Put the else (or elseif) on the same line as the previous closing brace

Per 
https://www.mediawiki.org/wiki/Manual:Coding_conventions#Indenting_and_alignment

Change-Id: I208981db0a866524156bad18cb687f010afeac2c
---
M includes/CacheHelper.php
M includes/EditPage.php
M includes/MimeMagic.php
M includes/Sanitizer.php
M includes/UserMailer.php
M includes/parser/Preprocessor_DOM.php
M includes/parser/Preprocessor_Hash.php
M includes/resourceloader/ResourceLoaderStartUpModule.php
8 files changed, 33 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/118764/1

diff --git a/includes/CacheHelper.php b/includes/CacheHelper.php
index f0ae5a3..f6cd3a6 100644
--- a/includes/CacheHelper.php
+++ b/includes/CacheHelper.php
@@ -205,8 +205,7 @@
'cachedspecial-viewing-cached-ttl',
$context-getLanguage()-formatDuration( 
$this-cacheExpiry )
)-escaped();
-   }
-   else {
+   } else {
$message = $context-msg(
'cachedspecial-viewing-cached-ts'
)-escaped();
@@ -277,25 +276,20 @@
 
if ( !is_integer( $itemKey ) ) {
wfWarn( Attempted to get item with 
non-numeric key while the next item in the queue has a key ($itemKey) in  . 
__METHOD__ );
-   }
-   elseif ( is_null( $itemKey ) ) {
+   } elseif ( is_null( $itemKey ) ) {
wfWarn( Attempted to get an item while 
the queue is empty in  . __METHOD__ );
-   }
-   else {
+   } else {
$value = array_shift( 
$this-cachedChunks );
}
-   }
-   else {
+   } else {
if ( array_key_exists( $key, 
$this-cachedChunks ) ) {
$value = $this-cachedChunks[$key];
unset( $this-cachedChunks[$key] );
-   }
-   else {
+   } else {
wfWarn( There is no item with key 
'$key' in this-cachedChunks in  . __METHOD__ );
}
}
-   }
-   else {
+   } else {
if ( !is_array( $args ) ) {
$args = array( $args );
}
@@ -305,8 +299,7 @@
if ( $this-cacheEnabled ) {
if ( is_null( $key ) ) {
$this-cachedChunks[] = $value;
-   }
-   else {
+   } else {
$this-cachedChunks[$key] = $value;
}
}
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 9a27d23..5f5cb53 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -772,8 +772,7 @@
$this-sectiontitle = $request-getVal( 
'preloadtitle' );
// Once wpSummary isn't being use for setting 
section titles, we should delete this.
$this-summary = $request-getVal( 
'preloadtitle' );
-   }
-   elseif ( $this-section != 'new'  $request-getVal( 
'summary' ) ) {
+   } elseif ( $this-section != 'new'  $request-getVal( 
'summary' ) ) {
$this-summary = $request-getText( 'summary' );
if ( $this-summary !== '' ) {
$this-hasPresetSummary = true;
diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php
index f5c28ab..e3b8577 100644
--- a/includes/MimeMagic.php
+++ b/includes/MimeMagic.php
@@ -508,8 +508,7 @@
// trust the file extension
$mime = $this-guessTypesForExtension( $ext );
}
-   }
-   elseif ( $mime === 'application/x-opc+zip' ) {
+   } elseif ( $mime === 'application/x-opc+zip' ) {
if ( $this-isMatchingExtension( $ext, $mime ) ) {
// A known file extension for 

[MediaWiki-commits] [Gerrit] Remove request_with_session/request_without_session from sho... - change (mediawiki/core)

2014-03-13 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118437

Change subject: Remove request_with_session/request_without_session from 
showCacheStats.php
..

Remove request_with_session/request_without_session from showCacheStats.php

Fix for I0ed1e87574 (42fcd43).

Since request_with_session/request_without_session were removed in the
mentionned commit, the maintenance/showCacheStats.php refuses to show
the other statistics.

Change-Id: I955cc537f8bc9116f759af5a5c3005aa7d60c83b
---
M maintenance/showCacheStats.php
1 file changed, 0 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/118437/1

diff --git a/maintenance/showCacheStats.php b/maintenance/showCacheStats.php
index 9168d6f..854910f 100644
--- a/maintenance/showCacheStats.php
+++ b/maintenance/showCacheStats.php
@@ -46,16 +46,6 @@
if ( get_class( $wgMemc ) == 'EmptyBagOStuff' ) {
$this-error( You are running EmptyBagOStuff, I can 
not provide any statistics., true );
}
-   $session = intval( $wgMemc-get( wfMemcKey( 'stats', 
'request_with_session' ) ) );
-   $noSession = intval( $wgMemc-get( wfMemcKey( 'stats', 
'request_without_session' ) ) );
-   $total = $session + $noSession;
-   if ( $total == 0 ) {
-   $this-error( You either have no stats or the cache 
isn't running. Aborting., true );
-   }
-   $this-output( Requests\n );
-   $this-output( sprintf( with session:  %-10d %6.2f%%\n, 
$session, $session / $total * 100 ) );
-   $this-output( sprintf( without session:   %-10d %6.2f%%\n, 
$noSession, $noSession / $total * 100 ) );
-   $this-output( sprintf( total: %-10d %6.2f%%\n, 
$total, 100 ) );
 
$this-output( \nParser cache\n );
$hits = intval( $wgMemc-get( wfMemcKey( 'stats', 'pcache_hit' 
) ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/118437
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I955cc537f8bc9116f759af5a5c3005aa7d60c83b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Don't use isset() to check whether an existing variable is null - change (mediawiki/core)

2014-03-11 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118092

Change subject: Don't use isset() to check whether an existing variable is null
..

Don't use isset() to check whether an existing variable is null

Change-Id: I05ad172f69189cbef86c65d5990e76edbedfd7c6
---
M includes/UserMailer.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/118092/1

diff --git a/includes/UserMailer.php b/includes/UserMailer.php
index fe80929..4d8fce8 100644
--- a/includes/UserMailer.php
+++ b/includes/UserMailer.php
@@ -276,7 +276,7 @@
$headers = $mime-headers( $headers );
}
}
-   if ( !isset( $mime ) ) {
+   if ( $mime === null ) {
// sending text only, either deliberately or as a 
fallback
if ( wfIsWindows() ) {
$body = str_replace( \n, \r\n, $body );

-- 
To view, visit https://gerrit.wikimedia.org/r/118092
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05ad172f69189cbef86c65d5990e76edbedfd7c6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add a deprecation notice of $wgRateLimitLog in RELEASE-NOTES - change (mediawiki/core)

2014-03-04 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/116755

Change subject: Add a deprecation notice of $wgRateLimitLog in RELEASE-NOTES
..

Add a deprecation notice of $wgRateLimitLog in RELEASE-NOTES

Follow-up I86131c4a80 (5b52c88).

Change-Id: I3e4f7c91fd6728052da877c2847c08d69f300dfe
---
M RELEASE-NOTES-1.23
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/116755/1

diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index 382b54f..abc7e8a 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -41,6 +41,8 @@
 * $wgSkipSkin, which has been replaceable by $wgSkipSkins since 2005 (r9249), 
is
   now formally deprecated.
 * Removed deprecated $wgDisabledActions as it is hardly used anywhere.
+* $wgRateLimitLog has been deprecated and replaced by
+  $wgDebugLogGroup['ratelimit'].
 
 === New features in 1.23 ===
 * ResourceLoader can utilize the Web Storage API to cache modules client-side.

-- 
To view, visit https://gerrit.wikimedia.org/r/116755
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e4f7c91fd6728052da877c2847c08d69f300dfe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update messages.inc and rebuild MessagesEn.php. Again. - change (mediawiki/core)

2014-03-01 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/116262

Change subject: Update messages.inc and rebuild MessagesEn.php. Again.
..

Update messages.inc and rebuild MessagesEn.php. Again.

Follow-up Id5c0225431 (7d923a6).

Change-Id: I663c28aa05a42917ba3988a02c2609b6c4e9a438
---
M languages/messages/MessagesEn.php
M maintenance/language/messages.inc
2 files changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/116262/1

diff --git a/languages/messages/MessagesEn.php 
b/languages/messages/MessagesEn.php
index 7a4b400..7bf42e6 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -2366,7 +2366,7 @@
 'php-uploaddisabledtext' = 'File uploads are disabled in PHP.
 Please check the file_uploads setting.',
 'uploadscripted' = 'This file contains HTML or script code 
that may be erroneously interpreted by a web browser.',
-'uploadscriptednamespace' = 'This SVG file contains an illegal namespace 
\'$1\'',
+'uploadscriptednamespace'= This SVG file contains an illegal 
namespace '$1',
 'uploadinvalidxml'   = 'The XML in the uploaded file could not be 
parsed.',
 'uploadvirus'= 'The file contains a virus!
 Details: $1',
diff --git a/maintenance/language/messages.inc 
b/maintenance/language/messages.inc
index 0172257..d97a4cd 100644
--- a/maintenance/language/messages.inc
+++ b/maintenance/language/messages.inc
@@ -1449,6 +1449,7 @@
'uploaddisabledtext',
'php-uploaddisabledtext',
'uploadscripted',
+   'uploadscriptednamespace',
'uploadinvalidxml',
'uploadvirus',
'uploadjava',

-- 
To view, visit https://gerrit.wikimedia.org/r/116262
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I663c28aa05a42917ba3988a02c2609b6c4e9a438
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Explicitely return null from WikiPage::newFromID() - change (mediawiki/core)

2014-02-13 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/113149

Change subject: Explicitely return null from WikiPage::newFromID()
..

Explicitely return null from WikiPage::newFromID()

Follow-up I8943b4dec5 (d7f465f).

To match the documentation.

Change-Id: I7b960704d6b3a83e389ece182bf94142341ea88c
---
M includes/WikiPage.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/113149/1

diff --git a/includes/WikiPage.php b/includes/WikiPage.php
index ee6f574..69c37ce 100644
--- a/includes/WikiPage.php
+++ b/includes/WikiPage.php
@@ -144,7 +144,7 @@
public static function newFromID( $id, $from = 'fromdb' ) {
// page id's are never 0 or negative, see bug 61166
if ( $id  1 ) {
-   return;
+   return null;
}
 
$from = self::convertSelectType( $from );

-- 
To view, visit https://gerrit.wikimedia.org/r/113149
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b960704d6b3a83e389ece182bf94142341ea88c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use wfShellWikiCmd() for the shell command in cleanupSpam.php - change (mediawiki/core)

2014-02-08 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/112297

Change subject: Use wfShellWikiCmd() for the shell command in cleanupSpam.php
..

Use wfShellWikiCmd() for the shell command in cleanupSpam.php

Change-Id: Id2c1dc9b313e1d833154a68a8eafa1e675d3b65c
---
M maintenance/cleanupSpam.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/112297/1

diff --git a/maintenance/cleanupSpam.php b/maintenance/cleanupSpam.php
index 4b8c9fe..12b1241 100644
--- a/maintenance/cleanupSpam.php
+++ b/maintenance/cleanupSpam.php
@@ -39,7 +39,7 @@
}
 
public function execute() {
-   global $wgLocalDatabases, $wgUser;
+   global $IP, $wgLocalDatabases, $wgUser;
 
$username = wfMessage( 'spambot_username' )-text();
$wgUser = User::newFromName( $username );
@@ -67,7 +67,9 @@
array( 'el_index' . $dbr-buildLike( 
$like ) ), __METHOD__ );
if ( $count ) {
$found = true;
-   passthru( php cleanupSpam.php 
--wiki='$wikiID' $spec | sed 's/^/$wikiID:  /' );
+   $cmd = wfShellWikiCmd( 
$IP/maintenance/cleanupSpam.php,
+   array( '--wiki', $wikiID, $spec 
) );
+   passthru( $cmd | sed 's/^/$wikiID:  
/' );
}
}
if ( $found ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/112297
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2c1dc9b313e1d833154a68a8eafa1e675d3b65c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Put line breaks after each element in OutputPage::headElement() - change (mediawiki/core)

2014-02-06 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/111794

Change subject: Put line breaks after each element in OutputPage::headElement()
..

Put line breaks after each element in OutputPage::headElement()

Change-Id: I4e7715a354e9d599fb2c77c09ac72a55462aaa5d
---
M includes/OutputPage.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/94/111794/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index aff4b16..2b1d4a0 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2510,14 +2510,14 @@
// Our XML declaration is output by Html::htmlHeader.
// 
http://www.whatwg.org/html/semantics.html#attr-meta-http-equiv-content-type
// http://www.whatwg.org/html/semantics.html#charset
-   $ret .= Html::element( 'meta', array( 'charset' = 
'UTF-8' ) );
+   $ret .= Html::element( 'meta', array( 'charset' = 
'UTF-8' ) ) . \n;
}
 
$ret .= Html::element( 'title', null, $this-getHTMLTitle() ) . 
\n;
 
// Avoid Internet Explorer compatibility view, so that
// jQuery can work correctly.
-   $ret .= Html::element( 'meta', array( 'http-equiv' = 
'X-UA-Compatible', 'content' = 'IE=EDGE' ) );
+   $ret .= Html::element( 'meta', array( 'http-equiv' = 
'X-UA-Compatible', 'content' = 'IE=EDGE' ) ) . \n;
 
$ret .= implode( \n, array(
$this-getHeadLinks(),

-- 
To view, visit https://gerrit.wikimedia.org/r/111794
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e7715a354e9d599fb2c77c09ac72a55462aaa5d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex coderev...@emsenhuber.ch

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


  1   2   3   4   5   6   7   8   >