Merge "Reduced some master queries via Revision::READ_NORMAL."
authorCatrope <roan.kattouw@gmail.com>
Tue, 28 Aug 2012 23:53:26 +0000 (23:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 28 Aug 2012 23:53:26 +0000 (23:53 +0000)
59 files changed:
.jshintignore
RELEASE-NOTES-1.20
api.php
extensions/README
includes/AutoLoader.php
includes/Category.php
includes/CategoryViewer.php
includes/DataUpdate.php
includes/EditPage.php
includes/GlobalFunctions.php
includes/OutputPage.php
includes/Skin.php
includes/SkinLegacy.php
includes/SkinTemplate.php
includes/Uri.php [deleted file]
includes/db/Database.php
includes/db/DatabasePostgres.php
includes/debug/Debug.php
includes/diff/DifferenceEngine.php
includes/filebackend/FileBackend.php
includes/filebackend/FileBackendMultiWrite.php
includes/filebackend/FileBackendStore.php
includes/filebackend/SwiftFileBackend.php
includes/filebackend/filejournal/DBFileJournal.php
includes/job/Job.php
includes/libs/CSSJanus.php
includes/parser/CoreParserFunctions.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialSearch.php
includes/specials/SpecialUndelete.php
includes/upload/UploadFromUrl.php
index.php
languages/messages/MessagesCkb.php
languages/messages/MessagesDiq.php
languages/messages/MessagesEn.php
languages/messages/MessagesGd.php
languages/messages/MessagesIt.php
languages/messages/MessagesJa.php
languages/messages/MessagesMl.php
languages/messages/MessagesPa.php
languages/messages/MessagesPms.php
languages/messages/MessagesTe.php
languages/messages/MessagesTet.php
languages/messages/MessagesUr.php
load.php
maintenance/Maintenance.php
maintenance/importSiteScripts.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc
resources/Resources.php
resources/jquery/jquery.jStorage.js [new file with mode: 0644]
skins/Standard.php
tests/TestsAutoLoader.php
tests/phpunit/includes/GlobalFunctions/GlobalTest.php
tests/phpunit/includes/MockOutputPage.php [deleted file]
tests/phpunit/includes/UriTest.php [deleted file]
tests/phpunit/includes/db/DatabaseSQLTest.php
tests/phpunit/includes/debug/MWDebugTest.php
thumb.php

index 9534f97..45f2da7 100644 (file)
@@ -8,6 +8,7 @@ resources/jquery/jquery.form.js
 resources/jquery/jquery.hoverIntent.js
 resources/jquery/jquery.js
 resources/jquery/jquery.json.js
+resources/jquery/jquery.jStorage.js
 resources/jquery/jquery.mockjax.js
 resources/jquery/jquery.qunit.js
 resources/jquery/jquery.validate.js
index e06dc7d..82ab330 100644 (file)
@@ -133,6 +133,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 39376) jquery.form upgraded to 3.14
 * SVG files will now show the actual width in the SVG's specified units
   in the metadata box.
+* Added ResourceLoader module "jquery.jStorage".
 
 === Bug fixes in 1.20 ===
 * (bug 30245) Use the correct way to construct a log page title.
@@ -260,6 +261,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 38904) prop=revisions&rvstart=... no longer blows up when continuing.
 * (bug 39032) ApiQuery generates help in constructor.
 * (bug 11142) Improve file extension blacklist error reporting in API upload
+* (bug 39635) PostgreSQL LOCK IN SHARE MODE option is a syntax error
 
 === Languages updated in 1.20 ===
 
diff --git a/api.php b/api.php
index ad420ff..7fae373 100644 (file)
--- a/api.php
+++ b/api.php
@@ -35,6 +35,7 @@ define( 'MW_API', true );
 
 // Bail if PHP is too low
 if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
+       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
        wfPHPVersionError( 'api.php' );
 }
index e810286..66236e8 100644 (file)
@@ -21,7 +21,7 @@ Please note that under POSIX systems (Linux...), parent of a symbolic path
 refers to the link source, NOT to the target! You should check the env
 variable MW_INSTALL_PATH in case the extension is not in the default location.
 
-The following code snippet lets you override the default path: 
+The following code snippet lets you override the default path:
 
  $IP = getenv( 'MW_INSTALL_PATH' );
  if( $IP === false ) {
index b299796..9d78dbd 100644 (file)
@@ -252,7 +252,6 @@ $wgAutoloadLocalClasses = array(
        'UnlistedSpecialPage' => 'includes/SpecialPage.php',
        'UploadSourceAdapter' => 'includes/Import.php',
        'UppercaseCollation' => 'includes/Collation.php',
-       'Uri' => 'includes/Uri.php',
        'User' => 'includes/User.php',
        'UserArray' => 'includes/UserArray.php',
        'UserArrayFromResult' => 'includes/UserArray.php',
@@ -1008,6 +1007,7 @@ $wgAutoloadLocalClasses = array(
        'Language' => 'languages/Language.php',
        'LanguageConverter' => 'languages/LanguageConverter.php',
        'CLDRPluralRuleEvaluator' => 'languages/utils/CLDRPluralRuleEvaluator.php',
+       'CLDRPluralRuleError' => 'languages/utils/CLDRPluralRuleEvaluator.php',
 
        # maintenance
        'ConvertLinks' => 'maintenance/convertLinks.php',
index d9ca234..b7b12e8 100644 (file)
@@ -297,8 +297,8 @@ class Category {
                        'IGNORE'
                );
 
-               $cond1 = $dbw->conditional( 'page_namespace=' . NS_CATEGORY, 1, 'NULL' );
-               $cond2 = $dbw->conditional( 'page_namespace=' . NS_FILE, 1, 'NULL' );
+               $cond1 = $dbw->conditional( array( 'page_namespace' => NS_CATEGORY ), 1, 'NULL' );
+               $cond2 = $dbw->conditional( array( 'page_namespace' => NS_FILE ), 1, 'NULL' );
                $result = $dbw->selectRow(
                        array( 'categorylinks', 'page' ),
                        array( 'pages' => 'COUNT(*)',
index 4e4f311..5f4aaea 100644 (file)
@@ -504,7 +504,7 @@ class CategoryViewer extends ContextSource {
                # Split into three columns
                $columns = array_chunk( $columns, ceil( count( $columns ) / 3 ), true /* preserve keys */ );
 
-               $ret = '<table width="100%"><tr valign="top">';
+               $ret = '<table width="100%"><tr style="vertical-align: top;">';
                $prevchar = null;
 
                foreach ( $columns as $column ) {
index 793d335..377b64c 100644 (file)
@@ -84,8 +84,8 @@ abstract class DataUpdate implements DeferrableUpdate {
                $exception = null;
 
                /**
-                * @var $update StorageUpdate
-                * @var $trans StorageUpdate
+                * @var $update DataUpdate
+                * @var $trans DataUpdate
                 */
 
                try {
index d60d73c..0389168 100644 (file)
@@ -2102,8 +2102,11 @@ class EditPage {
                                );
                        }
                }
+               # Add header copyright warning
+               $this->showHeaderCopyrightWarning();
        }
 
+
        /**
         * Standard summary input and label (wgSummary), abstracted so EditPage
         * subclasses may reorganize the form.
@@ -2399,6 +2402,18 @@ HTML
                $wgOut->addHTML( '<div id="wikiDiff">' . $difftext . '</div>' );
        }
 
+       /**
+        * Show the header copyright warning.
+        */
+       protected function showHeaderCopyrightWarning() {
+               $msg = 'editpage-head-copy-warn';
+               if ( !wfMessage( $msg )->isDisabled() ) {
+                       global $wgOut;
+                       $wgOut->wrapWikiMsg( "<div class='editpage-head-copywarn'>\n$1\n</div>",
+                               'editpage-head-copy-warn' );
+               }
+       }
+
        /**
         * Give a chance for site and per-namespace customizations of
         * terms of service summary link that might exist separately
index 35c7bbb..4ff258d 100644 (file)
@@ -391,7 +391,7 @@ function wfArrayToCgi( $array1, $array2 = null, $prefix = '' ) {
 
        $cgi = '';
        foreach ( $array1 as $key => $value ) {
-               if ( $value !== false ) {
+               if ( !is_null($value) && $value !== false ) {
                        if ( $cgi != '' ) {
                                $cgi .= '&';
                        }
@@ -412,11 +412,8 @@ function wfArrayToCgi( $array1, $array2 = null, $prefix = '' ) {
                        } else {
                                if ( is_object( $value ) ) {
                                        $value = $value->__toString();
-                               } elseif( !is_null( $value ) ) {
-                                       $cgi .= urlencode( $key ) . '=' . urlencode( $value );
-                               } else {
-                                       $cgi .= urlencode( $key );
                                }
+                               $cgi .= urlencode( $key ) . '=' . urlencode( $value );
                        }
                }
        }
@@ -443,15 +440,14 @@ function wfCgiToArray( $query ) {
                        continue;
                }
                if ( strpos( $bit, '=' ) === false ) {
-                       // Pieces like &qwerty become 'qwerty' => null
-                       $key = urldecode( $bit );
-                       $value = null;
+                       // Pieces like &qwerty become 'qwerty' => '' (at least this is what php does)
+                       $key = $bit;
+                       $value = '';
                } else {
                        list( $key, $value ) = explode( '=', $bit );
-                       $key = urldecode( $key );
-                       $value = urldecode( $value );
                }
-
+               $key = urldecode( $key );
+               $value = urldecode( $value );
                if ( strpos( $key, '[' ) !== false ) {
                        $keys = array_reverse( explode( '[', $key ) );
                        $key = array_pop( $keys );
@@ -476,15 +472,23 @@ function wfCgiToArray( $query ) {
  * Append a query string to an existing URL, which may or may not already
  * have query string parameters already. If so, they will be combined.
  *
- * @deprecated in 1.20. Use Uri class.
  * @param $url String
  * @param $query Mixed: string or associative array
  * @return string
  */
 function wfAppendQuery( $url, $query ) {
-       $obj = new Uri( $url );
-       $obj->extendQuery( $query );
-       return $obj->toString();
+       if ( is_array( $query ) ) {
+               $query = wfArrayToCgi( $query );
+       }
+       if( $query != '' ) {
+               if( false === strpos( $url, '?' ) ) {
+                       $url .= '?';
+               } else {
+                       $url .= '&';
+               }
+               $url .= $query;
+       }
+       return $url;
 }
 
 /**
@@ -572,13 +576,49 @@ function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
  * @todo Need to integrate this into wfExpandUrl (bug 32168)
  *
  * @since 1.19
- * @deprecated
  * @param $urlParts Array URL parts, as output from wfParseUrl
  * @return string URL assembled from its component parts
  */
 function wfAssembleUrl( $urlParts ) {
-       $obj = new Uri( $urlParts );
-       return $obj->toString();
+       $result = '';
+
+       if ( isset( $urlParts['delimiter'] ) ) {
+               if ( isset( $urlParts['scheme'] ) ) {
+                       $result .= $urlParts['scheme'];
+               }
+
+               $result .= $urlParts['delimiter'];
+       }
+
+       if ( isset( $urlParts['host'] ) ) {
+               if ( isset( $urlParts['user'] ) ) {
+                       $result .= $urlParts['user'];
+                       if ( isset( $urlParts['pass'] ) ) {
+                               $result .= ':' . $urlParts['pass'];
+                       }
+                       $result .= '@';
+               }
+
+               $result .= $urlParts['host'];
+
+               if ( isset( $urlParts['port'] ) ) {
+                       $result .= ':' . $urlParts['port'];
+               }
+       }
+
+       if ( isset( $urlParts['path'] ) ) {
+               $result .= $urlParts['path'];
+       }
+
+       if ( isset( $urlParts['query'] ) ) {
+               $result .= '?' . $urlParts['query'];
+       }
+
+       if ( isset( $urlParts['fragment'] ) ) {
+               $result .= '#' . $urlParts['fragment'];
+       }
+
+       return $result;
 }
 
 /**
@@ -725,13 +765,58 @@ function wfUrlProtocolsWithoutProtRel() {
  * 2) Handles protocols that don't use :// (e.g., mailto: and news: , as well as protocol-relative URLs) correctly
  * 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2))
  *
- * @deprecated
  * @param $url String: a URL to parse
  * @return Array: bits of the URL in an associative array, per PHP docs
  */
 function wfParseUrl( $url ) {
-       $obj = new Uri( $url );
-       return $obj->getComponents();
+       global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php
+
+       // Protocol-relative URLs are handled really badly by parse_url(). It's so bad that the easiest
+       // way to handle them is to just prepend 'http:' and strip the protocol out later
+       $wasRelative = substr( $url, 0, 2 ) == '//';
+       if ( $wasRelative ) {
+               $url = "http:$url";
+       }
+       wfSuppressWarnings();
+       $bits = parse_url( $url );
+       wfRestoreWarnings();
+       // parse_url() returns an array without scheme for some invalid URLs, e.g.
+       // parse_url("%0Ahttp://example.com") == array( 'host' => '%0Ahttp', 'path' => 'example.com' )
+       if ( !$bits || !isset( $bits['scheme'] ) ) {
+               return false;
+       }
+
+       // most of the protocols are followed by ://, but mailto: and sometimes news: not, check for it
+       if ( in_array( $bits['scheme'] . '://', $wgUrlProtocols ) ) {
+               $bits['delimiter'] = '://';
+       } elseif ( in_array( $bits['scheme'] . ':', $wgUrlProtocols ) ) {
+               $bits['delimiter'] = ':';
+               // parse_url detects for news: and mailto: the host part of an url as path
+               // We have to correct this wrong detection
+               if ( isset( $bits['path'] ) ) {
+                       $bits['host'] = $bits['path'];
+                       $bits['path'] = '';
+               }
+       } else {
+               return false;
+       }
+
+       /* Provide an empty host for eg. file:/// urls (see bug 28627) */
+       if ( !isset( $bits['host'] ) ) {
+               $bits['host'] = '';
+
+               /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
+               if ( substr( $bits['path'], 0, 1 ) !== '/' ) {
+                       $bits['path'] = '/' . $bits['path'];
+               }
+       }
+
+       // If the URL was protocol-relative, fix scheme and delimiter
+       if ( $wasRelative ) {
+               $bits['scheme'] = '';
+               $bits['delimiter'] = '//';
+       }
+       return $bits;
 }
 
 /**
@@ -847,10 +932,7 @@ function wfMatchesDomainList( $url, $domains ) {
  * @param $logonly Bool: set true to avoid appearing in HTML when $wgDebugComments is set
  */
 function wfDebug( $text, $logonly = false ) {
-       global $wgOut, $wgDebugLogFile, $wgDebugComments, $wgProfileOnly, $wgDebugRawPage;
-       global $wgDebugLogPrefix, $wgShowDebug;
-
-       static $cache = array(); // Cache of unoutputted messages
+       global $wgDebugLogFile, $wgProfileOnly, $wgDebugRawPage, $wgDebugLogPrefix;
 
        if ( !$wgDebugRawPage && wfIsDebugRawPage() ) {
                return;
@@ -861,15 +943,10 @@ function wfDebug( $text, $logonly = false ) {
                $text = preg_replace( '/[^\n]/', $timer . '\0', $text, 1 );
        }
 
-       if ( ( $wgDebugComments || $wgShowDebug ) && !$logonly ) {
-               $cache[] = $text;
-
-               if ( isset( $wgOut ) && is_object( $wgOut ) ) {
-                       // add the message and any cached messages to the output
-                       array_map( array( $wgOut, 'debug' ), $cache );
-                       $cache = array();
-               }
+       if ( !$logonly ) {
+               MWDebug::debugMsg( $text );
        }
+
        if ( wfRunHooks( 'Debug', array( $text, null /* no log group */ ) ) ) {
                if ( $wgDebugLogFile != '' && !$wgProfileOnly ) {
                        # Strip unprintables; they can switch terminal modes when binary data
@@ -879,8 +956,6 @@ function wfDebug( $text, $logonly = false ) {
                        wfErrorLog( $text, $wgDebugLogFile );
                }
        }
-
-       MWDebug::debugMsg( $text );
 }
 
 /**
@@ -1007,35 +1082,7 @@ function wfLogDBError( $text ) {
  * @return null
  */
 function wfDeprecated( $function, $version = false, $component = false, $callerOffset = 2 ) {
-       static $functionsWarned = array();
-
-       MWDebug::deprecated( $function, $version, $component );
-
-       if ( !isset( $functionsWarned[$function] ) ) {
-               $functionsWarned[$function] = true;
-
-               if ( $version ) {
-                       global $wgDeprecationReleaseLimit;
-
-                       if ( $wgDeprecationReleaseLimit && $component === false ) {
-                               # Strip -* off the end of $version so that branches can use the
-                               # format #.##-branchname to avoid issues if the branch is merged into
-                               # a version of MediaWiki later than what it was branched from
-                               $comparableVersion = preg_replace( '/-.*$/', '', $version );
-
-                               # If the comparableVersion is larger than our release limit then
-                               # skip the warning message for the deprecation
-                               if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
-                                       return;
-                               }
-                       }
-
-                       $component = $component === false ? 'MediaWiki' : $component;
-                       wfWarn( "Use of $function was deprecated in $component $version.", $callerOffset );
-               } else {
-                       wfWarn( "Use of $function is deprecated.", $callerOffset );
-               }
-       }
+       MWDebug::deprecated( $function, $version, $component, $callerOffset + 1 );
 }
 
 /**
@@ -1049,34 +1096,7 @@ function wfDeprecated( $function, $version = false, $component = false, $callerO
  *        is true
  */
 function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
-       global $wgDevelopmentWarnings;
-
-       MWDebug::warning( $msg, $callerOffset + 2 );
-
-       $callers = wfDebugBacktrace();
-       if ( isset( $callers[$callerOffset + 1] ) ) {
-               $callerfunc = $callers[$callerOffset + 1];
-               $callerfile = $callers[$callerOffset];
-               if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
-                       $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
-               } else {
-                       $file = '(internal function)';
-               }
-               $func = '';
-               if ( isset( $callerfunc['class'] ) ) {
-                       $func .= $callerfunc['class'] . '::';
-               }
-               if ( isset( $callerfunc['function'] ) ) {
-                       $func .= $callerfunc['function'];
-               }
-               $msg .= " [Called from $func in $file]";
-       }
-
-       if ( $wgDevelopmentWarnings ) {
-               trigger_error( $msg, $level );
-       } else {
-               wfDebug( "$msg\n" );
-       }
+       MWDebug::warning( $msg, $callerOffset + 1, $level );
 }
 
 /**
@@ -2308,11 +2328,7 @@ function wfSuppressWarnings( $end = false ) {
                }
        } else {
                if ( !$suppressCount ) {
-                       // E_DEPRECATED is undefined in PHP 5.2
-                       if( !defined( 'E_DEPRECATED' ) ) {
-                               define( 'E_DEPRECATED', 8192 );
-                       }
-                       $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED ) );
+                       $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED ) );
                }
                ++$suppressCount;
        }
index e9e2b6f..bc9eaa9 100644 (file)
@@ -56,9 +56,9 @@ class OutputPage extends ContextSource {
        /**
         * Holds the debug lines that will be output as comments in page source if
         * $wgDebugComments is enabled. See also $wgShowDebug.
-        * TODO: make a getter method for this
+        * @deprecated since 1.20; use MWDebug class instead.
         */
-       public $mDebugtext = ''; // TODO: we might want to replace it by wfDebug() wfDebugLog()
+       public $mDebugtext = '';
 
        /// Should be private. Stores contents of "<title>" tag
        var $mHTMLtitle = '';
@@ -1314,15 +1314,6 @@ class OutputPage extends ContextSource {
                return $this->mBodytext;
        }
 
-       /**
-        * Add $text to the debug output
-        *
-        * @param $text String: debug text
-        */
-       public function debug( $text ) {
-               $this->mDebugtext .= $text;
-       }
-
        /**
         * Get/set the ParserOptions object to use for wikitext parsing
         *
@@ -2032,10 +2023,6 @@ class OutputPage extends ContextSource {
         *                   based on $pageTitle
         */
        public function prepareErrorPage( $pageTitle, $htmlTitle = false ) {
-               if ( $this->getTitle() ) {
-                       $this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n";
-               }
-
                $this->setPageTitle( $pageTitle );
                if ( $htmlTitle !== false ) {
                        $this->setHTMLTitle( $htmlTitle );
index 5501d32..00eb5e8 100644 (file)
@@ -437,7 +437,7 @@ abstract class Skin extends ContextSource {
                if ( !empty( $allCats['normal'] ) ) {
                        $t = $embed . implode( "{$pop}{$embed}" , $allCats['normal'] ) . $pop;
 
-                       $msg = $this->msg( 'pagecategories', count( $allCats['normal'] ) )->escaped();
+                       $msg = $this->msg( 'pagecategories' )->numParams( count( $allCats['normal'] ) )->escaped();
                        $linkPage = wfMessage( 'pagecategorieslink' )->inContentLanguage()->text();
                        $s .= '<div id="mw-normal-catlinks" class="mw-normal-catlinks">' .
                                Linker::link( Title::newFromText( $linkPage ), $msg )
@@ -455,7 +455,7 @@ abstract class Skin extends ContextSource {
                        }
 
                        $s .= "<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" .
-                               $this->msg( 'hidden-categories', count( $allCats['hidden'] ) )->escaped() .
+                               $this->msg( 'hidden-categories' )->numParams( count( $allCats['hidden'] ) )->escaped() .
                                $colon . '<ul>' . $embed . implode( "{$pop}{$embed}" , $allCats['hidden'] ) . $pop . '</ul>' .
                                '</div>';
                }
@@ -568,71 +568,7 @@ abstract class Skin extends ContextSource {
         * @return String HTML containing debug data, if enabled (otherwise empty).
         */
        protected function generateDebugHTML() {
-               global $wgShowDebug;
-
-               $html = MWDebug::getDebugHTML( $this->getContext() );
-
-               if ( $wgShowDebug ) {
-                       $listInternals = $this->formatDebugHTML( $this->getOutput()->mDebugtext );
-                       $html .= "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">" .
-                               $listInternals . "</ul>\n";
-               }
-
-               return $html;
-       }
-
-       /**
-        * @param $debugText string
-        * @return string
-        */
-       private function formatDebugHTML( $debugText ) {
-               global $wgDebugTimestamps;
-
-               $lines = explode( "\n", $debugText );
-               $curIdent = 0;
-               $ret = '<li>';
-
-               foreach ( $lines as $line ) {
-                       $pre = '';
-                       if ( $wgDebugTimestamps ) {
-                               $matches = array();
-                               if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) {
-                                       $pre = $matches[1];
-                                       $line = substr( $line, strlen( $pre ) );
-                               }
-                       }
-                       $display = ltrim( $line );
-                       $ident = strlen( $line ) - strlen( $display );
-                       $diff = $ident - $curIdent;
-
-                       $display = $pre . $display;
-                       if ( $display == '' ) {
-                               $display = "\xc2\xa0";
-                       }
-
-                       if ( !$ident && $diff < 0 && substr( $display, 0, 9 ) != 'Entering ' && substr( $display, 0, 8 ) != 'Exiting ' ) {
-                               $ident = $curIdent;
-                               $diff = 0;
-                               $display = '<span style="background:yellow;">' . htmlspecialchars( $display ) . '</span>';
-                       } else {
-                               $display = htmlspecialchars( $display );
-                       }
-
-                       if ( $diff < 0 ) {
-                               $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n";
-                       } elseif ( $diff == 0 ) {
-                               $ret .= "</li><li>\n";
-                       } else {
-                               $ret .= str_repeat( "<ul><li>\n", $diff );
-                       }
-                       $ret .= "<tt>$display</tt>\n";
-
-                       $curIdent = $ident;
-               }
-
-               $ret .= str_repeat( '</li></ul>', $curIdent ) . '</li>';
-
-               return $ret;
+               return MWDebug::getHTMLDebugLog();
        }
 
        /**
@@ -899,7 +835,7 @@ abstract class Skin extends ContextSource {
         */
        function logoText( $align = '' ) {
                if ( $align != '' ) {
-                       $a = " align='{$align}'";
+                       $a = " style='float: {$align};'";
                } else {
                        $a = '';
                }
index aa6b22a..1ae1cb3 100644 (file)
@@ -123,18 +123,18 @@ class LegacyTemplate extends BaseTemplate {
                  "<table border='0' cellspacing='0' width='100%'>\n<tr>\n";
 
                if ( $this->getSkin()->qbSetting() == 0 ) {
-                       $s .= "<td class='top' align='left' valign='top' rowspan='{$rows}'>\n" .
+                       $s .= "<td class='top' style='text-align: left; vertical-align: top;' rowspan='{$rows}'>\n" .
                                $this->getSkin()->logoText( $wgLang->alignStart() ) . '</td>';
                }
 
                $l = $wgLang->alignStart();
-               $s .= "<td {$borderhack} align='$l' valign='top'>\n";
+               $s .= "<td {$borderhack} style='text-align: $l; vertical-align: top;'>\n";
 
                $s .= $this->topLinks();
                $s .= '<p class="subtitle">' . $this->pageTitleLinks() . "</p>\n";
 
                $r = $wgLang->alignEnd();
-               $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap='nowrap'>";
+               $s .= "</td>\n<td {$borderhack} style='text-align: $r; vertical-align: top;' nowrap='nowrap'>";
                $s .= $this->nameAndLogin();
                $s .= "\n<br />" . $this->searchForm() . '</td>';
 
index 2c869db..d3502e9 100644 (file)
@@ -135,7 +135,6 @@ class SkinTemplate extends Skin {
                global $wgDisableCounters, $wgSitename, $wgLogo, $wgHideInterlanguageLinks;
                global $wgMaxCredits, $wgShowCreditsIfMax;
                global $wgPageShowWatchingUsers;
-               global $wgDebugComments;
                global $wgArticlePath, $wgScriptPath, $wgServer;
 
                wfProfileIn( __METHOD__ );
@@ -387,12 +386,6 @@ class SkinTemplate extends Skin {
                        }
                }
 
-               if ( $wgDebugComments ) {
-                       $tpl->setRef( 'debug', $out->mDebugtext );
-               } else {
-                       $tpl->set( 'debug', '' );
-               }
-
                $tpl->set( 'sitenotice', $this->getSiteNotice() );
                $tpl->set( 'bottomscripts', $this->bottomScripts() );
                $tpl->set( 'printfooter', $this->printSource() );
@@ -468,6 +461,7 @@ class SkinTemplate extends Skin {
                        $tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() );
                }
 
+               $tpl->set( 'debug', '' );
                $tpl->set( 'debughtml', $this->generateDebugHTML() );
                $tpl->set( 'reporttime', wfReportTime() );
 
@@ -1886,13 +1880,7 @@ abstract class BaseTemplate extends QuickTemplate {
        function printTrail() { ?>
 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
 <?php $this->html( 'reporttime' ) ?>
-<?php if ( $this->data['debug'] ): ?>
-<!-- Debug output:
-<?php $this->text( 'debug' ); ?>
-
--->
-<?php endif;
+<?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() );
        }
 
 }
-
diff --git a/includes/Uri.php b/includes/Uri.php
deleted file mode 100644 (file)
index deabbb2..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-<?php
-/**
- * Class for simple URI parsing and manipulation.
- * Intended to simplify things that were using wfParseUrl and
- * had to do manual concatenation for various needs.
- * Built to match our JS mw.Uri in naming patterns.
- * @file
- * @author Daniel Friesen
- * @since 1.20
- */
-
-class Uri {
-
-       /**
-        * The parsed components of the URI
-        */
-       protected $components;
-
-       protected static $validComponents = array( 'scheme', 'delimiter', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment' );
-       protected static $componentAliases = array( 'protocol' => 'scheme', 'password' => 'pass' );
-
-       /**
-        * parse_url() work-alike, but non-broken.  Differences:
-        *
-        * 1) Does not raise warnings on bad URLs (just returns false)
-        * 2) Handles protocols that don't use :// (e.g., mailto: and news: , as well as protocol-relative URLs) correctly
-        * 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2))
-        *
-        * @param $url String: a URL to parse
-        * @return Array: bits of the URL in an associative array, per PHP docs
-        */
-       protected static function parseUri( $url ) {
-               global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php
-
-               // Protocol-relative URLs are handled really badly by parse_url(). It's so bad that the easiest
-               // way to handle them is to just prepend 'http:' and strip the protocol out later
-               $wasRelative = substr( $url, 0, 2 ) == '//';
-               if ( $wasRelative ) {
-                       $url = "http:$url";
-               }
-               wfSuppressWarnings();
-               $bits = parse_url( $url );
-               wfRestoreWarnings();
-               // parse_url() returns an array without scheme for some invalid URLs, e.g.
-               // parse_url("%0Ahttp://example.com") == array( 'host' => '%0Ahttp', 'path' => 'example.com' )
-               if ( !$bits ||
-                    !isset( $bits['scheme'] ) && strpos( $url, "://" ) !== false ) {
-                       wfDebug( __METHOD__ . ": Invalid URL: $url" );
-                       return false;
-               } else {
-                       $scheme = isset( $bits['scheme'] ) ? $bits['scheme'] : null;
-               }
-
-               // most of the protocols are followed by ://, but mailto: and sometimes news: not, check for it
-               if ( in_array( $scheme . '://', $wgUrlProtocols ) ) {
-                       $bits['delimiter'] = '://';
-               } elseif ( !is_null( $scheme ) && !in_array( $scheme . ':', $wgUrlProtocols ) ) {
-                       wfDebug( __METHOD__ . ": Invalid scheme in URL: $scheme" );
-                       return false;
-               } elseif( !is_null( $scheme ) ) {
-                       if( !in_array( $scheme . ':', $wgUrlProtocols ) ) {
-                               // For URLs that don't have a scheme, but do have a user:password, parse_url
-                               // detects the user as the scheme.
-                               unset( $bits['scheme'] );
-                               $bits['user'] = $scheme;
-                       } else {
-                               $bits['delimiter'] = ':';
-                               // parse_url detects for news: and mailto: the host part of an url as path
-                               // We have to correct this wrong detection
-                               if ( isset( $bits['path'] ) ) {
-                                       $bits['host'] = $bits['path'];
-                                       $bits['path'] = '';
-                               }
-                       }
-               }
-
-               /* Provide an empty host for eg. file:/// urls (see bug 28627) */
-               if ( !isset( $bits['host'] ) && $scheme == "file" ) {
-                       $bits['host'] = '';
-
-                       /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
-                       if ( isset( $bits['path'] ) && substr( $bits['path'], 0, 1 ) !== '/' ) {
-                               $bits['path'] = '/' . $bits['path'];
-                       }
-               }
-
-               // If the URL was protocol-relative, fix scheme and delimiter
-               if ( $wasRelative ) {
-                       $bits['scheme'] = '';
-                       $bits['delimiter'] = '//';
-               }
-               return $bits;
-       }
-
-       /**
-        *
-        * @param $uri mixed URI string or array
-        */
-       public function __construct( $uri ) {
-               $this->components = array();
-               $this->setUri( $uri );
-       }
-
-       /**
-        * Set the Uri to the value of some other URI.
-        *
-        * @param $uri mixed URI string or array
-        */
-       public function setUri( $uri ) {
-               if ( is_string( $uri ) ) {
-                       $parsed = self::parseUri( $uri );
-                       if( $parsed === false ) {
-                               return false;
-                       }
-                       $this->setComponents( $parsed );
-               } elseif ( is_array( $uri ) ) {
-                       $this->setComponents( $uri );
-               } elseif ( $uri instanceof Uri ) {
-                       $this->setComponents( $uri->getComponents() );
-               } else {
-                       throw new MWException( __METHOD__ . ": $uri is not of a valid type." );
-               }
-       }
-
-       /**
-        * Set the components of this array.
-        * Will output warnings when invalid components or aliases are found.
-        *
-        * @param $components Array The components to set on this Uri.
-        */
-       public function setComponents( array $components ) {
-               foreach ( $components as $name => $value ) {
-                       if ( isset( self::$componentAliases[$name] ) ) {
-                               $canonical = self::$componentAliases[$name];
-                               wfDebug( __METHOD__ . ": Converting alias $name to canonical $canonical." );
-                               $components[$canonical] = $value;
-                               unset( $components[$name] );
-                       } elseif ( !in_array( $name, self::$validComponents ) ) {
-                               throw new MWException( __METHOD__ . ": $name is not a valid component." );
-                       }
-               }
-
-               $this->components = $components;
-       }
-
-       /**
-        * Return the components for this Uri
-        * @return Array
-        */
-       public function getComponents() {
-               return $this->components;
-       }
-
-       /**
-        * Return the value of a specific component
-        *
-        * @param $name string The name of the component to return
-        * @param string|null
-        */
-       public function getComponent( $name ) {
-               if ( isset( self::$componentAliases[$name] ) ) {
-                       // Component is an alias. Get the actual name.
-                       $alias = $name;
-                       $name = self::$componentAliases[$name];
-                       wfDebug( __METHOD__ . ": Converting alias $alias to canonical $name." );
-               }
-
-               if( !in_array( $name, self::$validComponents ) ) {
-                       // Component is invalid
-                       throw new MWException( __METHOD__ . ": $name is not a valid component." );
-               } elseif( !empty( $this->components[$name] ) ) {
-                       // Component is valid and has a value.
-                       return $this->components[$name];
-               } else {
-                       // Component is empty
-                       return null;
-               }
-       }
-
-       /**
-        * Set a component for this Uri
-        * @param $name string The name of the component to set
-        * @param $value string|null The value to set
-        */
-       public function setComponent( $name, $value ) {
-               if ( isset( self::$componentAliases[$name] ) ) {
-                       $alias = $name;
-                       $name = self::$componentAliases[$name];
-                       wfDebug( __METHOD__ . ": Converting alias $alias to canonical $name." );
-               } elseif ( !in_array( $name, self::$validComponents ) ) {
-                       throw new MWException( __METHOD__ . ": $name is not a valid component." );
-               }
-               $this->components[$name] = $value;
-       }
-
-       public function getProtocol() { return $this->getComponent( 'scheme' ); }
-       public function getUser() { return $this->getComponent( 'user' ); }
-       public function getPassword() { return $this->getComponent( 'pass' ); }
-       public function getHost() { return $this->getComponent( 'host' ); }
-       public function getPort() { return $this->getComponent( 'port' ); }
-       public function getPath() { return $this->getComponent( 'path' ); }
-       public function getQueryString() { return $this->getComponent( 'query' ); }
-       public function getFragment() { return $this->getComponent( 'fragment' ); }
-
-       public function setProtocol( $scheme ) { $this->setComponent( 'scheme', $scheme ); }
-       public function setUser( $user ) { $this->setComponent( 'user', $user ); }
-       public function setPassword( $pass ) { $this->setComponent( 'pass', $pass ); }
-       public function setHost( $host ) { $this->setComponent( 'host', $host ); }
-       public function setPort( $port ) { $this->setComponent( 'port', $port ); }
-       public function setPath( $path ) { $this->setComponent( 'path', $path ); }
-       public function setFragment( $fragment ) { $this->setComponent( 'fragment', $fragment ); }
-
-       /**
-        * Gets the protocol-authority delimiter of a URI (:// or //).
-        * @return string|null
-        */
-       public function getDelimiter() {
-               $delimiter = $this->getComponent( 'delimiter' );
-               if ( $delimiter ) {
-                       // A specific delimiter is set, so return it.
-                       return $delimiter;
-               }
-               if ( $this->getAuthority() && $this->getProtocol() ) {
-                       // If the URI has a protocol and a body (i.e., some sort of host, etc.)
-                       // the default delimiter is "://", e.g., "http://test.com".
-                       return '://';
-               }
-               return null;
-       }
-
-       /**
-        * Gets query portion of a URI in array format.
-        * @return string
-        */
-       public function getQuery() {
-               return wfCgiToArray( $this->getQueryString() );
-       }
-
-       /**
-        * Gets query portion of a URI.
-        * @param string|array $query
-        */
-       public function setQuery( $query ) {
-               if ( is_array( $query ) ) {
-                       $query = wfArrayToCGI( $query );
-               }
-               $this->setComponent( 'query', $query );
-       }
-
-       /**
-        * Extend the query -- supply query parameters to override or add to ours
-        * @param Array|string $parameters query parameters to override or add
-        * @return Uri this URI object
-        */
-       public function extendQuery( $parameters ) {
-               if ( !is_array( $parameters ) ) {
-                       $parameters = wfCgiToArray( $parameters );
-               }
-
-               $query = $this->getQuery();
-               foreach( $parameters as $key => $value ) {
-                       $query[$key] = $value;
-               }
-
-               $this->setQuery( $query );
-               return $this;
-       }
-
-       /**
-        * Returns user and password portion of a URI.
-        * @return string
-        */
-       public function getUserInfo() {
-               $user = $this->getComponent( 'user' );
-               $pass = $this->getComponent( 'pass' );
-               return $pass ? "$user:$pass" : $user;
-       }
-
-       /**
-        * Gets host and port portion of a URI.
-        * @return string
-        */
-       public function getHostPort() {
-               $host = $this->getComponent( 'host' );
-               $port = $this->getComponent( 'port' );
-               return $port ? "$host:$port" : $host;
-       }
-
-       /**
-        * Returns the userInfo and host and port portion of the URI.
-        * In most real-world URLs, this is simply the hostname, but it is more general.
-        * @return string
-        */
-       public function getAuthority() {
-               $userinfo = $this->getUserInfo();
-               $hostinfo = $this->getHostPort();
-               return $userinfo ? "$userinfo@$hostinfo" : $hostinfo;
-       }
-
-       /**
-        * Returns everything after the authority section of the URI
-        * @return String
-        */
-       public function getRelativePath() {
-               $path = $this->getComponent( 'path' );
-               $query = $this->getComponent( 'query' );
-               $fragment = $this->getComponent( 'fragment' );
-
-               $retval = $path;
-               if( $query ) {
-                       $retval .= "?$query";
-               }
-               if( $fragment ) {
-                       $retval .= "#$fragment";
-               }
-               return $retval;
-       }
-
-       /**
-        * Gets the entire URI string. May not be precisely the same as input due to order of query arguments.
-        * @return String the URI string
-        */
-       public function toString() {
-               return $this->getComponent( 'scheme' ) . $this->getDelimiter() . $this->getAuthority() . $this->getRelativePath();
-       }
-
-       /**
-        * Gets the entire URI string. May not be precisely the same as input due to order of query arguments.
-        * @return String the URI string
-        */
-       public function __toString() {
-               return $this->toString();
-       }
-
-}
index 61061b2..ae5335b 100644 (file)
@@ -2621,12 +2621,15 @@ abstract class DatabaseBase implements DatabaseType {
         * Returns an SQL expression for a simple conditional.  This doesn't need
         * to be overridden unless CASE isn't supported in your DBMS.
         *
-        * @param $cond String: SQL expression which will result in a boolean value
+        * @param $cond string|array SQL expression which will result in a boolean value
         * @param $trueVal String: SQL expression to return if true
         * @param $falseVal String: SQL expression to return if false
         * @return String: SQL fragment
         */
        public function conditional( $cond, $trueVal, $falseVal ) {
+               if ( is_array( $cond ) ) {
+                       $cond = $this->makeList( $cond, LIST_AND );
+               }
                return " (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) ";
        }
 
index 8f8f5e8..457bf38 100644 (file)
@@ -1406,9 +1406,6 @@ SQL;
                if ( isset( $noKeyOptions['FOR UPDATE'] ) ) {
                        $postLimitTail .= ' FOR UPDATE';
                }
-               if ( isset( $noKeyOptions['LOCK IN SHARE MODE'] ) ) {
-                       $postLimitTail .= ' LOCK IN SHARE MODE';
-               }
                if ( isset( $noKeyOptions['DISTINCT'] ) || isset( $noKeyOptions['DISTINCTROW'] ) ) {
                        $startOpts .= 'DISTINCT';
                }
index 1ad25ae..d02bcf5 100644 (file)
@@ -133,70 +133,156 @@ class MWDebug {
         * Adds a warning entry to the log
         *
         * @since 1.19
-        * @param $msg
-        * @param int $callerOffset
+        * @param $msg string
+        * @param $callerOffset int
         * @return mixed
         */
-       public static function warning( $msg, $callerOffset = 1 ) {
-               if ( !self::$enabled ) {
-                       return;
-               }
+       public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
+               $callerDescription = self::getCallerDescription( $callerOffset );
 
-               // Check to see if there was already a deprecation notice, so not to
-               // get a duplicate warning
-               $logCount = count( self::$log );
-               $caller = wfGetCaller( $callerOffset + 1 );
-               if ( $logCount ) {
-                       $lastLog = self::$log[ $logCount - 1 ];
-                       if ( $lastLog['type'] == 'deprecated' && $lastLog['caller'] == $caller ) {
-                               return;
-                       }
-               }
+               self::sendWarning( $msg, $callerDescription, $level );
 
-               self::$log[] = array(
-                       'msg' => htmlspecialchars( $msg ),
-                       'type' => 'warn',
-                       'caller' => $caller,
-               );
+               if ( self::$enabled ) {
+                       self::$log[] = array(
+                               'msg' => htmlspecialchars( $msg ),
+                               'type' => 'warn',
+                               'caller' => $callerDescription['func'],
+                       );
+               }
        }
 
        /**
-        * Adds a depreciation entry to the log, along with a backtrace
+        * Show a warning that $function is deprecated.
+        * This will send it to the following locations:
+        * - Debug toolbar, with one item per function and caller, if $wgDebugToolbar
+        *   is set to true.
+        * - PHP's error log, with level E_USER_DEPRECATED, if $wgDevelopmentWarnings
+        *   is set to true.
+        * - MediaWiki's debug log, if $wgDevelopmentWarnings is set to false.
         *
         * @since 1.19
-        * @param $function
-        * @param $version
-        * @param $component
+        * @param $function string: Function that is deprecated.
+        * @param $version string|bool: Version in which the function was deprecated.
+        * @param $component string|bool: Component to which the function belongs.
+        *     If false, it is assumbed the function is in MediaWiki core.
+        * @param $callerOffset integer: How far up the callstack is the original
+        *    caller. 2 = function that called the function that called
+        *    MWDebug::deprecated() (Added in 1.20).
         * @return mixed
         */
-       public static function deprecated( $function, $version, $component ) {
-               if ( !self::$enabled ) {
-                       return;
-               }
+       public static function deprecated( $function, $version = false, $component = false, $callerOffset = 2 ) {
+               $callerDescription = self::getCallerDescription( $callerOffset );
+               $callerFunc = $callerDescription['func'];
 
-               // Chain: This function -> wfDeprecated -> deprecatedFunction -> caller
-               $caller = wfGetCaller( 4 );
+               $sendToLog = true;
 
                // Check to see if there already was a warning about this function
-               $functionString = "$function-$caller";
-               if ( in_array( $functionString, self::$deprecationWarnings ) ) {
+               if ( isset( self::$deprecationWarnings[$function][$callerFunc] ) ) {
                        return;
+               } elseif ( isset( self::$deprecationWarnings[$function] ) ) {
+                       if ( self::$enabled ) {
+                               $sendToLog = false;
+                       } else {
+                               return;
+                       }
                }
 
-               $version = $version === false ? '(unknown version)' : $version;
-               $component = $component === false ? 'MediaWiki' : $component;
-               $msg = htmlspecialchars( "Use of function $function was deprecated in $component $version" );
-               $msg .= Html::rawElement( 'div', array( 'class' => 'mw-debug-backtrace' ),
-                       Html::element( 'span', array(), 'Backtrace:' )
-                        . wfBacktrace()
-               );
+               self::$deprecationWarnings[$function][$callerFunc] = true;
 
-               self::$deprecationWarnings[] = $functionString;
-               self::$log[] = array(
-                       'msg' => $msg,
-                       'type' => 'deprecated',
-                       'caller' => $caller,
-               );
+               if ( $version ) {
+                       global $wgDeprecationReleaseLimit;
+                       if ( $wgDeprecationReleaseLimit && $component === false ) {
+                               # Strip -* off the end of $version so that branches can use the
+                               # format #.##-branchname to avoid issues if the branch is merged into
+                               # a version of MediaWiki later than what it was branched from
+                               $comparableVersion = preg_replace( '/-.*$/', '', $version );
+
+                               # If the comparableVersion is larger than our release limit then
+                               # skip the warning message for the deprecation
+                               if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
+                                       $sendToLog = false;
+                               }
+                       }
+
+                       $component = $component === false ? 'MediaWiki' : $component;
+                       $msg = "Use of $function was deprecated in $component $version.";
+               } else {
+                       $msg = "Use of $function is deprecated.";
+               }
+
+               if ( $sendToLog ) {
+                       self::sendWarning( $msg, $callerDescription, E_USER_DEPRECATED );
+               }
+
+               if ( self::$enabled ) {
+                       $logMsg = htmlspecialchars( $msg ) .
+                               Html::rawElement( 'div', array( 'class' => 'mw-debug-backtrace' ),
+                                       Html::element( 'span', array(), 'Backtrace:' ) . wfBacktrace()
+                               );
+
+                       self::$log[] = array(
+                               'msg' => $logMsg,
+                               'type' => 'deprecated',
+                               'caller' => $callerFunc,
+                       );
+               }
+       }
+
+       /**
+        * Get an array describing the calling function at a specified offset.
+        *
+        * @param $callerOffset integer: How far up the callstack is the original
+        *    caller. 0 = function that called getCallerDescription()
+        * @return array with two keys: 'file' and 'func'
+        */
+       private static function getCallerDescription( $callerOffset ) {
+               $callers = wfDebugBacktrace();
+
+               if ( isset( $callers[$callerOffset] ) ) {
+                       $callerfile = $callers[$callerOffset];
+                       if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
+                               $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
+                       } else {
+                               $file = '(internal function)';
+                       }
+               } else {
+                       $file = '(unknown location)';
+               }
+
+               if ( isset( $callers[$callerOffset + 1] ) ) {
+                       $callerfunc = $callers[$callerOffset + 1];
+                       $func = '';
+                       if ( isset( $callerfunc['class'] ) ) {
+                               $func .= $callerfunc['class'] . '::';
+                       }
+                       if ( isset( $callerfunc['function'] ) ) {
+                               $func .= $callerfunc['function'];
+                       }
+               } else {
+                       $func = 'unknown';
+               }
+
+               return array( 'file' => $file, 'func' => $func );
+       }
+
+       /**
+        * Send a warning either to the debug log or by triggering an user PHP
+        * error depending on $wgDevelopmentWarnings.
+        *
+        * @param $msg string Message to send
+        * @param $caller array caller description get from getCallerDescription()
+        * @param $level error level to use if $wgDevelopmentWarnings is true
+        */
+       private static function sendWarning( $msg, $caller, $level ) {
+               global $wgDevelopmentWarnings;
+
+               $msg .= ' [Called from ' . $caller['func'] . ' in ' . $caller['file'] . ']';
+
+               if ( $wgDevelopmentWarnings ) {
+                       trigger_error( $msg, $level );
+               } else {
+                       wfDebug( "$msg\n" );
+               }
        }
 
        /**
@@ -207,11 +293,11 @@ class MWDebug {
         * @param $str string
         */
        public static function debugMsg( $str ) {
-               if ( !self::$enabled ) {
-                       return;
-               }
+               global $wgDebugComments, $wgShowDebug;
 
-               self::$debug[] = trim( $str );
+               if ( self::$enabled || $wgDebugComments || $wgShowDebug ) {
+                       self::$debug[] = rtrim( $str );
+               }
        }
 
        /**
@@ -283,22 +369,91 @@ class MWDebug {
         * @return string
         */
        public static function getDebugHTML( IContextSource $context ) {
-               if ( !self::$enabled ) {
+               global $wgDebugComments;
+
+               $html = '';
+
+               if ( self::$enabled ) {
+                       MWDebug::log( 'MWDebug output complete' );
+                       $debugInfo = self::getDebugInfo( $context );
+
+                       // Cannot use OutputPage::addJsConfigVars because those are already outputted
+                       // by the time this method is called.
+                       $html = Html::inlineScript(
+                               ResourceLoader::makeLoaderConditionalScript(
+                                       ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
+                               )
+                       );
+               }
+
+               if ( $wgDebugComments ) {
+                       $html .= "<!-- Debug output:\n" .
+                               htmlspecialchars( implode( "\n", self::$debug ) ) .
+                               "\n\n-->";
+               }
+
+               return $html;
+       }
+
+       /**
+        * Generate debug log in HTML for displaying at the bottom of the main
+        * content area.
+        * If $wgShowDebug is false, an empty string is always returned.
+        *
+        * @since 1.20
+        * @return string HTML fragment
+        */
+       public static function getHTMLDebugLog() {
+               global $wgDebugTimestamps, $wgShowDebug;
+
+               if ( !$wgShowDebug ) {
                        return '';
                }
 
-               MWDebug::log( 'MWDebug output complete' );
-               $debugInfo = self::getDebugInfo( $context );
+               $curIdent = 0;
+               $ret = "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">\n<li>";
 
-               // Cannot use OutputPage::addJsConfigVars because those are already outputted
-               // by the time this method is called.
-               $html = Html::inlineScript(
-                       ResourceLoader::makeLoaderConditionalScript(
-                               ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
-                       )
-               );
+               foreach ( self::$debug as $line ) {
+                       $pre = '';
+                       if ( $wgDebugTimestamps ) {
+                               $matches = array();
+                               if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) {
+                                       $pre = $matches[1];
+                                       $line = substr( $line, strlen( $pre ) );
+                               }
+                       }
+                       $display = ltrim( $line );
+                       $ident = strlen( $line ) - strlen( $display );
+                       $diff = $ident - $curIdent;
 
-               return $html;
+                       $display = $pre . $display;
+                       if ( $display == '' ) {
+                               $display = "\xc2\xa0";
+                       }
+
+                       if ( !$ident && $diff < 0 && substr( $display, 0, 9 ) != 'Entering ' && substr( $display, 0, 8 ) != 'Exiting ' ) {
+                               $ident = $curIdent;
+                               $diff = 0;
+                               $display = '<span style="background:yellow;">' . nl2br( htmlspecialchars( $display ) ) . '</span>';
+                       } else {
+                               $display = nl2br( htmlspecialchars( $display ) );
+                       }
+
+                       if ( $diff < 0 ) {
+                               $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n";
+                       } elseif ( $diff == 0 ) {
+                               $ret .= "</li><li>\n";
+                       } else {
+                               $ret .= str_repeat( "<ul><li>\n", $diff );
+                       }
+                       $ret .= "<tt>$display</tt>\n";
+
+                       $curIdent = $ident;
+               }
+
+               $ret .= str_repeat( '</li></ul>', $curIdent ) . "</li>\n</ul>\n";
+
+               return $ret;
        }
 
        /**
index d9092da..3846473 100644 (file)
@@ -917,7 +917,7 @@ class DifferenceEngine extends ContextSource {
 
                if ( !$diff && !$otitle ) {
                        $header .= "
-                       <tr valign='top'>
+                       <tr style='vertical-align: top;'>
                        <td class='diff-ntitle'>{$ntitle}</td>
                        </tr>";
                        $multiColspan = 1;
@@ -935,17 +935,17 @@ class DifferenceEngine extends ContextSource {
                                $multiColspan = 2;
                        }
                        $header .= "
-                       <tr valign='top'>
+                       <tr style='vertical-align: top;'>
                        <td colspan='$colspan' class='diff-otitle'>{$otitle}</td>
                        <td colspan='$colspan' class='diff-ntitle'>{$ntitle}</td>
                        </tr>";
                }
 
                if ( $multi != '' ) {
-                       $header .= "<tr><td colspan='{$multiColspan}' align='center' class='diff-multi'>{$multi}</td></tr>";
+                       $header .= "<tr><td colspan='{$multiColspan}' style='text-align: center;' class='diff-multi'>{$multi}</td></tr>";
                }
                if ( $notice != '' ) {
-                       $header .= "<tr><td colspan='{$multiColspan}' align='center'>{$notice}</td></tr>";
+                       $header .= "<tr><td colspan='{$multiColspan}' style='text-align: center;'>{$notice}</td></tr>";
                }
 
                return $header . $diff . "</table>";
index 4b707fc..daa8f22 100644 (file)
@@ -242,6 +242,9 @@ abstract class FileBackend {
         *   - allowStale          : Don't require the latest available data.
         *                           This can increase performance for non-critical writes.
         *                           This has no effect unless the 'force' flag is set.
+        *   - preserveCache       : Don't clear the process cache before checking files.
+        *                           This should only be used if all entries in the process
+        *                           cache were added after the files were already locked.
         *   - nonJournaled        : Don't log this operation batch in the file journal.
         *                           This limits the ability of recovery scripts.
         *   - parallelize         : Try to do operations in parallel when possible.
index 0c8968a..59392f6 100644 (file)
@@ -151,6 +151,7 @@ class FileBackendMultiWrite extends FileBackend {
                }
                // Clear any cache entries (after locks acquired)
                $this->clearCache();
+               $opts['preserveCache'] = true; // only locked files are cached
                // Do a consistency check to see if the backends agree
                $status->merge( $this->consistencyCheck( $this->fileStoragePathsForOps( $ops ) ) );
                if ( !$status->isOK() ) {
index 852a653..9311a90 100644 (file)
@@ -989,7 +989,9 @@ abstract class FileBackendStore extends FileBackend {
                }
 
                // Clear any file cache entries (after locks acquired)
-               $this->clearCache();
+               if ( empty( $opts['preserveCache'] ) ) {
+                       $this->clearCache();
+               }
 
                // Load from the persistent file and container caches
                $this->primeFileCache( $performOps );
index f54f666..9c111c9 100644 (file)
@@ -111,7 +111,7 @@ class SwiftFileBackend extends FileBackendStore {
                        : false;
                $this->swiftCDNExpiry = isset( $config['swiftCDNExpiry'] )
                        ? $config['swiftCDNExpiry']
-                       : 3600; // hour
+                       : 12*3600; // 12 hours is safe (tokens last 24 hours per http://docs.openstack.org)
                $this->swiftCDNPurgable = isset( $config['swiftCDNPurgable'] )
                        ? $config['swiftCDNPurgable']
                        : true;
@@ -852,13 +852,13 @@ class SwiftFileBackend extends FileBackendStore {
                                                // See function "create_container_table" in common/db.py.
                                                // If a directory is not "greater" than the last one,
                                                // then it was already listed by the calling iterator.
-                                               if ( $objectDir > $lastDir ) {
+                                               if ( strcmp( $objectDir, $lastDir ) > 0 ) {
                                                        $pDir = $objectDir;
                                                        do { // add dir and all its parent dirs
                                                                $dirs[] = "{$pDir}/";
                                                                $pDir = $this->getParentDir( $pDir );
                                                        } while ( $pDir !== false // sanity
-                                                               && $pDir > $lastDir // not done already
+                                                               && strcmp( $pDir, $lastDir ) > 0 // not done already
                                                                && strlen( $pDir ) > strlen( $dir ) // within $dir
                                                        );
                                                }
@@ -1297,6 +1297,9 @@ class SwiftFileBackend extends FileBackendStore {
                if ( $e->getMessage() ) {
                        trigger_error( "$func: " . $e->getMessage(), E_USER_WARNING );
                }
+               if ( $e instanceof InvalidResponseException ) { // possibly a stale token
+                       $this->srvCache->delete( $this->getCredsCacheKey( $this->auth->username ) );
+               }
                wfDebugLog( 'SwiftBackend',
                        get_class( $e ) . " in '{$func}' (given '" . FormatJson::encode( $params ) . "')" .
                        ( $e->getMessage() ? ": {$e->getMessage()}" : "" )
index 8fa4c6f..f6268c2 100644 (file)
@@ -27,6 +27,9 @@
  * @since 1.20
  */
 class DBFileJournal extends FileJournal {
+       /** @var DatabaseBase */
+       protected $dbw;
+
        protected $wiki = false; // string; wiki DB name
 
        /**
@@ -71,9 +74,7 @@ class DBFileJournal extends FileJournal {
                }
 
                try {
-                       $dbw->begin();
                        $dbw->insert( 'filejournal', $data, __METHOD__ );
-                       $dbw->commit();
                } catch ( DBError $e ) {
                        $status->fatal( 'filejournal-fail-dbquery', $this->backend );
                        return $status;
@@ -125,12 +126,10 @@ class DBFileJournal extends FileJournal {
                $dbw = $this->getMasterDB();
                $dbCutoff = $dbw->timestamp( time() - 86400 * $this->ttlDays );
 
-               $dbw->begin();
                $dbw->delete( 'filejournal',
                        array( 'fj_timestamp < ' . $dbw->addQuotes( $dbCutoff ) ),
                        __METHOD__
                );
-               $dbw->commit();
 
                return $status;
        }
@@ -142,7 +141,12 @@ class DBFileJournal extends FileJournal {
         * @throws DBError
         */
        protected function getMasterDB() {
-               $lb = wfGetLBFactory()->newMainLB();
-               return $lb->getConnection( DB_MASTER, array(), $this->wiki );
+               if ( !$this->dbw ) {
+                       // Get a separate connection in autocommit mode
+                       $lb = wfGetLBFactory()->newMainLB();
+                       $this->dbw = $lb->getConnection( DB_MASTER, array(), $this->wiki );
+                       $this->dbw->clearFlag( DBO_TRX );
+               }
+               return $this->dbw;
        }
 }
index d7c9563..45f0570 100644 (file)
@@ -153,7 +153,6 @@ abstract class Job {
                $dbw = wfGetDB( DB_MASTER );
                $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
                $affected = $dbw->affectedRows();
-               $dbw->commit( __METHOD__ );
 
                if ( !$affected ) {
                        // Failed, someone else beat us to it
@@ -177,7 +176,6 @@ abstract class Job {
                        // Delete the random row
                        $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
                        $affected = $dbw->affectedRows();
-                       $dbw->commit( __METHOD__ );
 
                        if ( !$affected ) {
                                // Random job gone before we exclusively deleted it
index e6672b4..4ebbc49 100644 (file)
@@ -268,10 +268,17 @@ class CSSJanus {
         * @return string
         */
        private static function fixBackgroundPosition( $css ) {
-               $css = preg_replace_callback( self::$patterns['bg_horizontal_percentage'],
+               $replaced = preg_replace_callback( self::$patterns['bg_horizontal_percentage'],
                        array( 'self', 'calculateNewBackgroundPosition' ), $css );
-               $css = preg_replace_callback( self::$patterns['bg_horizontal_percentage_x'],
+               if ( $replaced !== null ) {
+                       // Check for null; sometimes preg_replace_callback() returns null here for some weird reason
+                       $css = $replaced;
+               }
+               $replaced = preg_replace_callback( self::$patterns['bg_horizontal_percentage_x'],
                        array( 'self', 'calculateNewBackgroundPosition' ), $css );
+               if ( $replaced !== null ) {
+                       $css = $replaced;
+               }
 
                return $css;
        }
index 237c0a7..8917b6d 100644 (file)
@@ -342,6 +342,7 @@ class CoreParserFunctions {
        static function plural( $parser, $text = '' ) {
                $forms = array_slice( func_get_args(), 2 );
                $text = $parser->getFunctionLang()->parseFormattedNumber( $text );
+               settype( $text, ctype_digit( $text ) ? 'int' : 'float' );
                return $parser->getFunctionLang()->convertPlural( $text, $forms );
        }
 
index ff2a901..991e7a2 100644 (file)
@@ -94,17 +94,17 @@ class DeletedContribsPager extends IndexPager {
                if ( isset( $this->mNavigationBar ) ) {
                        return $this->mNavigationBar;
                }
-               $lang = $this->getLanguage();
-               $fmtLimit = $lang->formatNum( $this->mLimit );
+
                $linkTexts = array(
-                       'prev' => $this->msg( 'pager-newer-n', $fmtLimit )->escaped(),
-                       'next' => $this->msg( 'pager-older-n', $fmtLimit )->escaped(),
+                       'prev' => $this->msg( 'pager-newer-n' )->numParams( $this->mLimit )->escaped(),
+                       'next' => $this->msg( 'pager-older-n' )->numParams( $this->mLimit )->escaped(),
                        'first' => $this->msg( 'histlast' )->escaped(),
                        'last' => $this->msg( 'histfirst' )->escaped()
                );
 
                $pagingLinks = $this->getPagingLinks( $linkTexts );
                $limitLinks = $this->getLimitLinks();
+               $lang = $this->getLanguage();
                $limits = $lang->pipeList( $limitLinks );
 
                $this->mNavigationBar = "(" . $lang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " .
index 3344436..85365f5 100644 (file)
@@ -667,10 +667,10 @@ class SpecialSearch extends SpecialPage {
                                        return "<li>" .
                                                '<table class="searchResultImage">' .
                                                '<tr>' .
-                                               '<td width="120" align="center" valign="top">' .
+                                               '<td width="120" style="text-align: center; vertical-align: top;">' .
                                                $thumb->toHtml( array( 'desc-link' => true ) ) .
                                                '</td>' .
-                                               '<td valign="top">' .
+                                               '<td style="vertical-align: top;">' .
                                                $link .
                                                $extract .
                                                "<div class='mw-search-result-data'>{$score}{$desc} - {$date}{$related}</div>" .
index 3a6fab3..6dde6b9 100644 (file)
@@ -914,10 +914,10 @@ class SpecialUndelete extends SpecialPage {
                        "<col class='diff-marker' />" .
                        "<col class='diff-content' />" .
                        "<tr>" .
-                               "<td colspan='2' width='50%' align='center' class='diff-otitle'>" .
+                               "<td colspan='2' width='50%' style='text-align: center' class='diff-otitle'>" .
                                $this->diffHeader( $previousRev, 'o' ) .
                                "</td>\n" .
-                               "<td colspan='2' width='50%' align='center' class='diff-ntitle'>" .
+                               "<td colspan='2' width='50%' style='text-align: center' class='diff-ntitle'>" .
                                $this->diffHeader( $currentRev, 'n' ) .
                                "</td>\n" .
                        "</tr>" .
index fdd2b1a..c11d719 100644 (file)
@@ -70,14 +70,13 @@ class UploadFromUrl extends UploadBase {
                if ( !count( $wgCopyUploadsDomains ) ) {
                        return true;
                }
-               $uri = new Uri( $url );
-               $parsedDomain = $uri->getHost();
-               if ( $parsedDomain === null ) {
+               $parsedUrl = wfParseUrl( $url );
+               if ( !$parsedUrl ) {
                        return false;
                }
                $valid = false;
                foreach( $wgCopyUploadsDomains as $domain ) {
-                       if ( $parsedDomain === $domain ) {
+                       if ( $parsedUrl['host'] === $domain ) {
                                $valid = true;
                                break;
                        }
index 2ee17f8..0e9676d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -41,6 +41,7 @@
 # PHP 4. Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and
 # 5.1, respectively.
 if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
+       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
        wfPHPVersionError( 'index.php' );
 }
index 92fb0b7..9529363 100644 (file)
@@ -808,6 +808,7 @@ $2
 'note' => "'''تێبینی:'''",
 'previewnote' => "'''لە بیرت نەچێت ئەمە تەنیا پێشبینینە.'''
 گۆڕانکارییەکانت ھێشتا پاشەکەوت نەکراون!",
+'continue-editing' => 'بەردەوام بە لەدەستکاریکردن',
 'previewconflict' => 'ئەم پێشبینینە بە تۆ نیشان ئەدات ئەو دەقەی لە شوێنی دەستکاری سەرەوە داتناوە چۆن بەرچاو ئەکەوێت ئەگەر پاشەکەوتی بکەیت.',
 'session_fail_preview' => "'''ببوورە! ناتوانین دەستکارییەکەت پێواژۆ بکەین بە ھۆی لەدەستدانی session data.'''
 تکایە دیسان ھەوڵبدەوە.
@@ -1697,6 +1698,7 @@ $1',
 **لادان لە مافەکانی بڵاوکردنەوە
 ***پەڕگەی دووبارەکراوە',
 'filedelete-edit-reasonlist' => 'دەستکاری هۆکارەکانی سڕینەوە',
+'filedelete-maintenance-title' => 'ناتوانیت پەڕگە بسڕیتەوە',
 
 # MIME search
 'mimesearch' => 'گەڕانی MIME',
@@ -1759,7 +1761,7 @@ $1',
 ئێستا ڕەوانکەرە بۆ [[$2]].',
 'double-redirect-fixer' => 'چارەسەرکەری ڕەوانکەر',
 
-'brokenredirects' => 'ڕەوانەکراوە شکاوەکان',
+'brokenredirects' => 'ڕەوانەکەرە شکاوەکان',
 'brokenredirectstext' => 'ئەم ڕەوانەکراوانە بەستەرن بۆ ئەو پەڕانە کە بوونیان نییە:',
 'brokenredirects-edit' => 'دەستکاری',
 'brokenredirects-delete' => 'سڕینەوە',
@@ -1872,6 +1874,9 @@ $1',
 'allpages-bad-ns' => '{{SITENAME}} ناوبۆشایی نیە "$1".',
 'allpages-hide-redirects' => 'ڕەوانەکراوەکان بشارەوە',
 
+# SpecialCachedPage
+'cachedspecial-refresh-now' => 'دواترین پیشانبدە',
+
 # Special:Categories
 'categories' => 'پۆلەكان',
 'categoriespagetext' => 'ئەم {{PLURAL:$1|پۆلە پەڕە یان پەڕگەی|پۆلانە پەڕە یان پەڕگەیان}} لەخۆگرتە.
@@ -2100,7 +2105,7 @@ $UNWATCHURL
 'protectedarticle' => '«[[$1]]»ی پاراست',
 'modifiedarticleprotection' => 'ئاستی پاراستنی «[[$1]]»ی گۆڕا',
 'unprotectedarticle' => 'پاراستنی لەسەر «[[$1]]» لابرد',
-'movedarticleprotection' => 'ڕێککارییەکانی پاراستن لە  "[[$2]]" گوازرایەوە بۆ "[[$1]]"',
+'movedarticleprotection' => 'ڕێککارییەکانی پاراستن لە  «[[$2]]» گوازرایەوە بۆ «[[$1]]»',
 'protect-title' => 'گۆڕینی ئاستی پاراستنی "$1"',
 'prot_1movedto2' => '[[$1]] گوازرایەوە بۆ [[$2]]',
 'protect-legend' => 'پاراستن تەیید بکە',
@@ -2425,7 +2430,7 @@ $1',
 'movepagebtn' => 'ئەم پەڕەیە بگوازەوە',
 'pagemovedsub' => 'گواستنەوە بە سەرکەوتوویی جێبەجێ کرا',
 'movepage-moved' => "'''«$1» گوازرایەوە بۆ «$2»'''",
-'movepage-moved-redirect' => 'ڕەوانکەرێک درووست‌کرا.',
+'movepage-moved-redirect' => 'ڕەوانەکەرێک دروست کرا.',
 'movepage-moved-noredirect' => 'لە دانانی ڕەوانەکەر بەرگری کرا.',
 'articleexists' => 'پەڕەیەک بەم ناوە ھەیە یان ئەو ناوەی تۆ ھەڵتبژاردووە ڕێگەی پێنەدراوە.
 تکایە ناوێکی دیکە ھەڵبژێرە.',
@@ -2435,7 +2440,7 @@ $1',
 'movedto' => 'گواسترایەوە بۆ',
 'movetalk' => 'پەڕەی وتووێژی پەیوەندیدار بگوازەوە',
 'move-subpages' => 'ژێرپەڕەکانی بگوازەوە (ھەتا $1 پەڕە)',
-'move-talk-subpages' => 'ژێرپەڕەکانی پەڕەی وتووێژی بگۆزەرەوە (ھەتاکوو $1)',
+'move-talk-subpages' => 'ژێرپەڕەکانی پەڕەی وتووێژ بگوازەوە (ھەتا $1 پەڕە)',
 'movepage-page-exists' => 'پەڕەی $1 هەیە و ناتوانرێت خۆکار بخرێتە جێی.',
 'movepage-page-moved' => 'پەڕەی $1 گۆزرایەوە بۆ $2.',
 'movepage-page-unmoved' => 'ناکرێ پەڕەی $1 بگوێزرێتەوە بۆ $2.',
@@ -2444,7 +2449,7 @@ $1',
 'movelogpagetext' => 'لە خوارەوەدا لیستی ھەموو پەڕە گواستنەوەکان دەبینن.',
 'movesubpage' => '{{PLURAL:$1|ژێرپەڕە|ژێرپەڕە}}',
 'movesubpagetext' => 'ئەم لاپەڕە $1 {{PLURAL:$1|ژێرلاپەڕەی‌|ژێرلاپەڕەی}} هەیە کە لەخوارە نیشان دراوە.',
-'movenosubpage' => 'ئەم پەڕە ھیچ ژێرپەڕەیەکی نییە.',
+'movenosubpage' => 'ئەم پەڕەیە ھیچ ژێرپەڕەیەکی نییە.',
 'movereason' => 'ھۆکار:',
 'revertmove' => 'پێچەوانەکردنەوە',
 'delete_and_move' => 'بیسڕەوە و بیگوازەوە',
@@ -2663,9 +2668,11 @@ $1',
 
 # Info page
 'pageinfo-title' => 'زانیاری بۆ «$1»',
+'pageinfo-header-basic' => 'زانیاریی سەرەتایی',
 'pageinfo-header-edits' => 'دەستکاریەکان',
 'pageinfo-views' => 'ژمارەی بینینەکان',
 'pageinfo-watchers' => 'ژمارەی چاودێران',
+'pageinfo-firstuser' => 'دروستکەری پەڕە',
 'pageinfo-edits' => 'ژمارەی دەستکارییەکان',
 
 # Skin names
@@ -2777,8 +2784,11 @@ $1',
 'exif-imagelength' => 'بەرزی',
 'exif-imagedescription' => 'ناونیشانی وێنە',
 'exif-model' => 'جۆری کامێرا',
+'exif-software' => 'نەرمەواڵەی بەکارهاتوو',
 'exif-artist' => 'نووسەر',
 'exif-colorspace' => 'بۆشایی ره‌نگ',
+'exif-pixelydimension' => 'پانی وێنە',
+'exif-pixelxdimension' => 'بەرزی وێنە',
 'exif-usercomment' => 'بۆچوونەکانی بەکارهێنەر',
 'exif-relatedsoundfile' => 'فایلی ده‌نگی لێکچوو',
 'exif-lightsource' => 'سەرچاوەی ڕووناکی',
@@ -2794,6 +2804,10 @@ $1',
 'exif-gpstrack' => 'ئاڕاستەی جوڵان',
 'exif-gpsimgdirection' => 'ئاڕاستەی وێنە',
 'exif-gpsdatestamp' => 'ڕێکەوتی GPS',
+'exif-objectname' => 'سەردێری کورت',
+'exif-headline' => 'سەردێر',
+'exif-source' => 'سەرچاوە',
+'exif-copyrighted' => 'ڕەوشی مافی لەبەرگرتنەوە',
 
 # EXIF attributes
 'exif-compression-1' => 'نەپەستێنراو',
@@ -2903,6 +2917,18 @@ $1',
 'exif-gpsspeed-k' => 'کیلۆمەتر هەر کاتژمێر',
 'exif-gpsspeed-m' => 'مایل هەر کاتژمێر',
 
+# Pseudotags used for GPSDestDistanceRef
+'exif-gpsdestdistance-k' => 'کیلۆمەتر',
+'exif-gpsdestdistance-m' => 'میل',
+'exif-gpsdestdistance-n' => 'میکی دەریایی',
+
+'exif-dc-date' => 'ڕۆژ(ەکان)',
+'exif-dc-publisher' => 'بڵاوکار',
+'exif-dc-relation' => 'پەڕگەی پەیوەندیدار',
+'exif-dc-rights' => 'مافەکان',
+'exif-dc-source' => 'سەرچاوەی پەڕگە',
+'exif-dc-type' => 'جۆری پەڕگە',
+
 'exif-iimcategory-hth' => 'تەندروستی',
 'exif-iimcategory-sci' => 'زانست و تەکنۆلۆژیا',
 'exif-iimcategory-soi' => 'بابەتە کۆمەڵایەتییەکان',
index 8e97155..1e17799 100644 (file)
@@ -1985,6 +1985,7 @@ listeya ke ha ver a têna na {{PLURAL:$1|dosyaya ewwili|dosyaya $1 ewwili}} mocn
 'shared-repo' => 'yew embarê repositoryî',
 'shared-repo-name-wikimediacommons' => 'Wikimedia Commons',
 'filepage.css' => '/* CSS placed here is included on the file description page, also included on foreign client wikis */',
+'upload-disallowed-here' => 'Nê asengi sero theba nênusneyêno.',
 
 # File reversion
 'filerevert' => '$1 reyna biyere',
@@ -3089,7 +3090,7 @@ Tı eşkeno yew sebeb bınus.',
 'pageinfo-authors' => 'Amarina nuştekaran pêro',
 'pageinfo-recent-edits' => 'Amariya vurnayışan ($1 ra nata)',
 'pageinfo-recent-authors' => 'Amarina nuştekaran pêro',
-'pageinfo-restriction' => 'Xısusiyetê pela da  (<code>$1</code>)',
+'pageinfo-restriction' => 'Xısusiyetê pela (<code>{{lcfirst:$1}}</code>)',
 'pageinfo-magic-words' => '{{PLURAL:$1|Çekuya|Çekuyê}} ($1) sihırini',
 'pageinfo-hidden-categories' => '{{PLURAL:$1|Kategoriye|Kategoriyan}} ($1) bınımne',
 'pageinfo-templates' => '{{PLURAL:$1|Şablon|Şabloni}} ($1) açarneyayê',
@@ -3148,6 +3149,7 @@ Gurênayışê nae de, beno ke sistemê şıma zerar bıvêno.",
 'file-info-size-pages' => '$1 × $2 pikse, dergeya dosyay: $3, MIME tipiya cı: $4, $5 {{PLURAL:$5|pela|pela}}',
 'file-nohires' => 'Rovıleşiyayışo berzêr çıniyo.',
 'svg-long-desc' => 'SVG dosya, nominalin $1 × $2 piksels, ebatê dosya: $3',
+'svg-long-desc-animated' => 'SVG dosya, nominalin $1 × $2 piksela, ebatê dosya: $3',
 'show-big-image' => 'Resolosyonê temami',
 'show-big-image-preview' => "Verqayd dergiya: $1'i.",
 'show-big-image-other' => 'Zewmi{{PLURAL:$2|Vılêşnayış|Vılêşnayışê}}: $1.',
@@ -3157,6 +3159,8 @@ Gurênayışê nae de, beno ke sistemê şıma zerar bıvêno.",
 'file-info-png-looped' => 'atlama biyo',
 'file-info-png-repeat' => '$1 {{PLURAL:$1|hew|hew}} kay biyê',
 'file-info-png-frames' => '$1 {{PLURAL:$1|çerçeve|çerçeveyi}}',
+'file-no-thumb-animation' => "'''Not: Dılet tekniko limit, gırd agozneya resm de qıckek de animasyoni miyan dı nêbo.'''",
+'file-no-thumb-animation-gif' => "'''Not: Dılet tekniko limit, gırd agozneya resm de qıckek de  GIF imaci de animasyon do nêbo.'''",
 
 # Special:NewFiles
 'newimages' => 'Galeriya dosyayan dê newan',
index 0828bbe..910c0ae 100644 (file)
@@ -1435,6 +1435,7 @@ You are also promising us that you wrote this yourself, or copied it from a publ
 If you do not want your writing to be edited mercilessly, then do not submit it here.<br />
 You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see $1 for details).
 '''Do not submit copyrighted work without permission!'''",
+'editpage-head-copy-warn'          => '-', # do not translate or duplicate this message to other languages
 'editpage-tos-summary'             => '-', # do not translate or duplicate this message to other languages
 'longpage-hint'                    => '-', # do not translate or duplicate this message to other languages
 'longpageerror'                    => "'''Error: The text you have submitted is {{PLURAL:$1|one kilobyte|$1 kilobytes}} long, which is longer than the maximum of {{PLURAL:$2|one kilobyte|$2 kilobytes}}.'''
index 23349b8..83abaea 100644 (file)
@@ -251,7 +251,7 @@ $messages = array(
 'otherlanguages' => 'Ann an cànain eile',
 'redirectedfrom' => '(Air ath-sheòladh o $1)',
 'redirectpagesub' => 'Ath-sheòl an duilleag',
-'lastmodifiedat' => 'Chaidh an duilleag seo a mhùthadh $1, aig $2 turas mu dheireadh.',
+'lastmodifiedat' => 'Chaidh an duilleag seo a mhùthadh $1 aig $2 turas mu dheireadh.',
 'viewcount' => 'Chaidh inntrigeadh a dhèanam dhan duilleag seo {{PLURAL:$1|aon turas|$1 thuras|$1 turas|$1 turais|$1 turas}}.',
 'protectedpage' => 'Duilleag fo dhìon',
 'jumpto' => 'Gearr leum gu:',
@@ -731,8 +731,13 @@ Mur obraich e fhathast, feuch is [[Special:UserLogout|clàraich a-mach]] is a-st
 
 '''Mas e deasachadh dligheach a tha seo, feuch ris a-rithist.'''
 Mur obraich e fhathast, feuch is [[Special:UserLogout|clàraich a-mach]] is a-steach a-rithist an uairsin.",
+'token_suffix_mismatch' => "'''Dhiùlt sinn na dheasaich thu a chionn 's gun do chuir an cliant agad na caractaran puingeachaidh tro chèile san tòcan deasachaidh.'''
+Dhiùlt sinn na dheasaich thu air eagal 's gun coirbeadh e teacsa na duilleige.
+Tachraidh seo uaireannan ma chleachdar seirbheis-lìn progsaidh gun urra a tha làn de mhearachdan.",
+'edit_form_incomplete' => "'''Cha do ràinig cuid dhen fhoirm deasachaidh am frithealaichte; dèan cinnteach gu bheil gach deasachadh agad slàn is feuch ris a-rithist.'''",
 'editing' => "A' deasachadh $1",
 'editingsection' => "A' deasachadh $1 (earrann)",
+'editingcomment' => "A' deasachadh $1 (earrann ùr)",
 'editconflict' => 'Còmhstri deasachaidh: $1',
 'explainconflict' => "Tha cuideigin eile air an duilleag seo a mhùthadh on a thòisich thu fhèin air a dheasachadh.
 Tha am bogsa teacsa gu h-àrd a' nochdadh na duilleige mar a tha i an-dràsta.
@@ -741,6 +746,8 @@ Bidh agad ris na mùthaidhean agad fhilleadh a-steach san teacsa làithreach.
 Cha dèid '''ach an teacsa gu h-àrd''' a shàbhaladh nuair a bhriogas tu air \"{{int:savearticle}}\".",
 'yourtext' => 'An teacsa agad',
 'storedversion' => 'Lethbhreac taisgte',
+'nonunicodebrowser' => "'''Rabhadh: Chan eil am brabhsair agad co-chòrdail le Unicode.'''
+Chuir sinn gleus air dòigh dhut a nì cinnteach gun urrainn dhut duilleagan a shàbhaladh gu tèarainte: Nochdaidh caractaran taobh a-muigh ASCII mar chòd sia-dheicheach sa bhogsa deasachaidh.",
 'editingold' => "'''RABHADH: Tha thu a' deasachadh lethbhreac seann-aimsireil na duilleige seo.
 Ma shàbhalas tu seo, thèid gach mùthadh air chall a rinneadh a-mach on mhùthadh seo.'''",
 'yourdiff' => 'Caochlaidhean',
@@ -752,10 +759,22 @@ Tha thu a' toirt geall cuideachd gun do sgrìobh thu fhèin seo no gun do rinn t
 Mur eil thu ag iarraidh an sgrìobhaidh agad a dheasaichear is a sgaoilear le càch, na cuir e.<br />
 Ma dh'fhoilleachas tu rudeigin an seo, bidh tu a' dearbhadh gun do sgrìobh thu fhèin e, no gur ann às an raon phòballach a thàinig e; thoir aire '''nach eil''' sin a' gabhail a-staigh duilleagan-lìn mar as àbhaist (seall $1 airson barrachd fiosrachaidh). <br />
 '''NA CLEACHDAIBH SAOTHAIR FO DHLIGHE-SGRÌOBHAIDH GUN CHEAD!'''",
+'longpageerror' => "'''Mearachd: Tha an teacsa a chur thu thugainn {{PLURAL:$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|$1 kilobyte|}} a dh'fhaid is tha sin nas fhaide na tha ceadaichte ({{PLURAL:$1 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|$2 kilobyte|}}).'''
+Cha ghabh a shàbhaladh.",
+'readonlywarning' => "'''Rabhadh: Chaidh an stòr-dàta a ghlasadh a chum obair-ghlèidhidh agus chan urrainn dhut na còraichean-deasachaidh agad a chur gu feum an-dràsta fhèin.'''
+'S mathaid gum b' fheairrde dhut lethbhreac a dhèanamh dhen teacsa agus a shàbhaladh ann am faidhle ach an urrainn dhut a chleachdadh as a dhèidh seo.
+
+Seo am mìneachadh a thug an rianaire a ghlais e: $1",
 'protectedpagewarning' => "'''Rabhadh: Chaidh an duilleag seo a dhìon 's chan urrainn ach dhan fheadhainn aig a bheil ùghdarras rianaire a dheasachadh.'''
 Chì thu an clàr mu dheireadh san loga mar fhiosrachadh dhut gu h-ìosal:",
+'semiprotectedpagewarning' => "'''An aire:''' Chaidh an duilleag seo a dhìon 's chan fhaod ach cleachdaichean clàraichte a dheasachadh.
+Seo an rud mu dheireadh san loga mar fhiosrachadh dhut:",
+'cascadeprotectedwarning' => "'''Rabhadh:''' Chaidh an duilleag seo a dhìon 's chan fhaod ach rianairean a dheasachadh a chionn 's gun robh e am broinn {{PLURAL:$1|na duilleige|nan duilleagan}} a leanas a tha cascade-protected.",
+'titleprotectedwarning' => "'''Rabhadh: Chaidh an duilleag seo a dhìon 's feumar [[Special:ListGroupRights|còraichean sònraichte]] gus a dheasachadh.'''
+Seo an rud mu dheireadh san loga mar fhiosrachadh dhut:",
 'templatesused' => "Tha {{PLURAL:$1|teamplaid|theamplaid||teamplaid|theamplaid|teamplaidean|teamplaid}} 'gan cleachdadh air an duilleag seo:",
 'templatesusedpreview' => "Tha {{PLURAL:$1|teamplaid 'ga cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh}} san ro-shealladh seo:",
+'templatesusedsection' => "Tha {{PLURAL:$1|teamplaid 'ga cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh|teamplaidean 'gan cleachdadh}} san earrann seo:",
 'template-protected' => '(air a dhìon)',
 'template-semiprotected' => '(air a leth-dhìon)',
 'hiddencategories' => "Tha an duilleag seo 'na ball de {{PLURAL:$1|1 roinn-seòrsa fhalaichte|$1 roinn-seòrsa fhalaichte|1 roinn-seòrsa fhalaichte|$1 roinn-seòrsa fhalaichte|$1 roinnean-seòrsa falaichte|$1 roinn-seòrsa fhalaichte}}:",
index a97ec76..2986d89 100644 (file)
@@ -927,7 +927,7 @@ I dettagli possono essere trovati nel [{{fullurl:{{#Special:Log}}/delete|page={{
 L'ultimo elemento del registro dei blocchi è riportato di seguito per informazione:",
 'clearyourcache' => "'''Nota:''' dopo aver salvato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti. 
 *'''Firefox / Safari''': tenere premuto il tasto delle maiuscole e fare clic su ''Ricarica'', oppure premere ''Ctrl-F5'' o ''Ctrl-R'' (''⌘-R'' su Mac)
-*'''Google Chrome''': premere ''Ctrl-Shift-R'' (''⌘-Shift-R'' su un Mac)
+*'''Google Chrome''': fare clic su ''Ricarica'', oppure premere ''Ctrl-R'' o ''Ctrl-Shift-R'' (''⌘-Shift-R'' su un Mac)
 *'''Internet Explorer''': tenere premuto il tasto ''Ctrl'' mentre si fa clic su ''Refresh'', oppure premere ''Ctrl-F5''
 *'''Opera''': svuotare completamente la cache dal menu ''Strumenti → Preferenze''",
 'usercssyoucanpreview' => "'''Suggerimento:''' usa il pulsante 'Visualizza anteprima' per provare il tuo nuovo CSS prima di salvarlo.",
index 5e4ec33..80f5376 100644 (file)
@@ -887,9 +887,9 @@ Cookieを有効にしていることを確認して、このページを再読
 'resetpass_announce' => 'メールでお送りした仮パスワードでログインしました。
 ログインを完了するには、ここで新しいパスワードを設定する必要があります:',
 'resetpass_text' => '<!-- ここに文を挿入 -->',
-'resetpass_header' => 'ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\81®ã\83\91ã\82¹ã\83¯ã\83¼ã\83\89ã\82\92変更',
-'oldpassword' => '古いパスワード',
-'newpassword' => '新しいパスワード',
+'resetpass_header' => 'ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\81®ã\83\91ã\82¹ã\83¯ã\83¼ã\83\89ã\81®変更',
+'oldpassword' => '古いパスワード:',
+'newpassword' => '新しいパスワード:',
 'retypenew' => '新しいパスワードを再入力:',
 'resetpass_submit' => '再設定してログイン',
 'resetpass_success' => 'パスワードの変更に成功しました!
@@ -2928,8 +2928,8 @@ hideuser権限を持っていないため、この利用者のブロックを閲
 手動で統合してください。'''",
 'movedto' => '移動先:',
 'movetalk' => '付随するトークページも移動',
-'move-subpages' => '下位ページも移動($1ページまで)',
-'move-talk-subpages' => 'トークページの下位ページも移動($1まで)',
+'move-subpages' => '下位ページも移動($1 件まで)',
+'move-talk-subpages' => 'トークページの下位ページも移動($1 件まで)',
 'movepage-page-exists' => 'ページ「$1」は既に存在するため、自動的な上書きはできませんでした。',
 'movepage-page-moved' => 'ページ「$1」は「$2」に移動しました。',
 'movepage-page-unmoved' => 'ページ「$1」は「$2」に移動できませんでした。',
@@ -2937,7 +2937,7 @@ hideuser権限を持っていないため、この利用者のブロックを閲
 'movelogpage' => '移動記録',
 'movelogpagetext' => '以下はすべてのページ移動の一覧です。',
 'movesubpage' => '{{PLURAL:$1|下位ページ}}',
-'movesubpagetext' => 'このページには{{PLURAL:$1|下位ページ}}が以下の $1 件あります。',
+'movesubpagetext' => 'このページには、以下の $1 {{PLURAL:$1|下位ページ}}があります。',
 'movenosubpage' => 'このページに下位ページはありません。',
 'movereason' => '理由:',
 'revertmove' => '差し戻し',
@@ -3397,6 +3397,11 @@ Variants for Chinese language
 'variantname-ike-latn' => 'イヌクティトゥット語 (ラテン文字)',
 'variantname-iu' => 'イヌクティトゥット語',
 
+# Variants for Tachelhit language
+'variantname-shi-tfng' => 'シルハ語 (ティフィナグ文字)',
+'variantname-shi-latn' => 'シルハ語 (ラテン文字)',
+'variantname-shi' => 'シルハ語',
+
 # Metadata
 'metadata' => 'メタデータ',
 'metadata-help' => 'このファイルには、追加情報があります(おそらく、作成やデジタル化する際に使用したデジタルカメラやスキャナーが追加したものです)。
index cfb4bab..f2f8323 100644 (file)
@@ -16,6 +16,7 @@
  * @author Junaidpv
  * @author Jyothis
  * @author Kaganer
+ * @author Krenair
  * @author Manjith Joseph <manjithkaini@gmail.com>
  * @author Naveen Sankar
  * @author Praveen Prakash <me.praveen@gmail.com>
@@ -962,8 +963,8 @@ $1 ആണ് ഈ തടയൽ നടത്തിയത്. ''$2'' എന്ന
 'newarticle' => '(പുതിയത്)',
 'newarticletext' => 'ഇതുവരെ നിലവിലില്ലാത്ത ഒരു താൾ സൃഷ്ടിക്കാനുള്ള ശ്രമത്തിലാണ് താങ്കൾ. അതിനായി താഴെ ആവശ്യമുള്ള വിവരങ്ങൾ എഴുതിച്ചേർത്ത് സേവ് ചെയ്യുക (കൂടുതൽ വിവരങ്ങൾക്ക് [[{{MediaWiki:Helppage}}|സഹായം താൾ]] കാണുക). താങ്കളിവിടെ അബദ്ധത്തിൽ വന്നതാണെങ്കിൽ ബ്രൗസറിന്റെ ബാക്ക് ബട്ടൺ ഞെക്കിയാൽ തിരിച്ചുപോകാം.',
 'anontalkpagetext' => "----
-{| class=\"messagebox standard-talk\" style=\"border: 1px solid #B3B300; background-color:#FFFFBF;\"
-|align=\"left\" |
+{| class=\"messagebox standard-talk\" style=\"border: 1px solid #B3B300; background-color:#FFFFBF; text-align: left;\"
+|
 ''ഇതുവരെ അംഗത്വം എടുക്കാതിരിക്കുകയോ, നിലവിലുള്ള അംഗത്വം ഉപയോഗിക്കാതിരിക്കുകയോ ചെയ്യുന്ന '''ഒരു അജ്ഞാത ഉപയോക്താവിന്റെ സം‌വാദം താളാണിത്'''.
 അതിനാൽ അദ്ദേഹത്തെ തിരിച്ചറിയുവാൻ അക്കരൂപത്തിലുള്ള ഐ.പി. വിലാസം ഉപയോഗിക്കേണ്ടതുണ്ട്. ഇത്തരം ഒരു ഐ.പി. വിലാസം പല ഉപയോക്താക്കൾ പങ്കുവെക്കുന്നുണ്ടാവാം.
 താങ്കൾ ഈ സന്ദേശം ലഭിച്ച ഒരു അജ്ഞാത ഉപയോക്താവാണെങ്കിൽ, ഭാവിയിൽ ഇതര ഉപയോക്താക്കളുമായി ഉണ്ടായേക്കാവുന്ന ആശയക്കുഴപ്പം ഒഴിവാക്കാൻ ദയവായി [[Special:UserLogin/signup|ഒരു അംഗത്വമെടുക്കുക]] അല്ലെങ്കിൽ  [[Special:UserLogin|പ്രവേശിക്കുക]].
index 4cef353..b192f98 100644 (file)
@@ -1890,9 +1890,9 @@ delete|ਮਿਟਾਉਣਾਂ ਦਾ ਚਿੱਠਾ]] ਵੇਖੋ।',
 'spamprotectiontitle' => 'Spam ਸੁਰੱਖਿਆ ਫਿਲਟਰ',
 
 # Info page
-'pageinfo-header-edits' => 'ਸੋਧਾਂ',
-'pageinfo-watchers' => 'ਨà¨\9c਼ਰ à¨°à©±à¨\96ਣ à¨µà¨¾à¨²à¨¼à¨¿à¨\86à¨\82 à¨¦à©\80 à¨\97ਿਣਤà©\80',
-'pageinfo-edits' => 'ਸà©\8bਧਾà¨\82 à¨¦à©\80 à¨\97ਿਣਤà©\80',
+'pageinfo-header-edits' => 'ਸੋਧਾਂ ਦਾ ਅਤੀਤ',
+'pageinfo-watchers' => 'ਸਫ਼à©\87 â\80\99ਤà©\87 à¨¨à¨\9c਼ਰ à¨°à©±à¨\96ਣ à¨µà¨¾à¨²à¨¼à©\87',
+'pageinfo-edits' => 'à¨\95à©\81ੱਲ à¨¸à©\8bਧਾà¨\82',
 
 # Skin names
 'skinname-standard' => 'ਕਲਾਸਿਕ',
index e551c96..eec58cc 100644 (file)
@@ -2754,7 +2754,7 @@ A peul visualisene la sorgiss",
 'tooltip-t-permalink' => 'Anliura fissa a sta version-sì dla pàgina',
 'tooltip-ca-nstab-main' => 'Vardé la pàgina ëd contnù.',
 'tooltip-ca-nstab-user' => 'Vardé la pàgina Utent.',
-'tooltip-ca-nstab-media' => 'Vardé la pàgina dl',
+'tooltip-ca-nstab-media' => 'Vardé la pàgina dël mojen',
 'tooltip-ca-nstab-special' => 'Costa a l',
 'tooltip-ca-nstab-project' => 'Vardé la pàgina proteta.',
 'tooltip-ca-nstab-image' => 'Vardé la pàgina dl',
index 8146d9a..148206a 100644 (file)
@@ -7,6 +7,7 @@
  * @ingroup Language
  * @file
  *
+ * @author Arjunaraoc
  * @author Chaduvari
  * @author Jprmvnvijay5
  * @author Kaganer
@@ -692,6 +693,7 @@ $2
 # Special:ChangeEmail
 'changeemail' => 'ఈ-మెయిలు చిరునామా మార్పు',
 'changeemail-header' => 'ఖాతా ఈ-మెయిల్ చిరునామాని మార్చండి',
+'changeemail-text' => 'మీ ఈమెయిల్ చిరునామా మార్చుటకు ఈ ఫారము నింపండి. ఈ మార్పుని ఖచ్చితపరచుటకు మీ సంకేతపదం  ప్రవేశపెట్టాలి.',
 'changeemail-no-info' => 'ఈ పేజీని నేరుగా చూడటానికి మీరు లోనికి ప్రవేశించివుండాలి.',
 'changeemail-oldemail' => 'ప్రస్తుత ఈ-మెయిలు చిరునామా:',
 'changeemail-newemail' => 'కొత్త ఈ-మెయిలు చిరునామా:',
index 5e17126..4ddee10 100644 (file)
@@ -764,6 +764,7 @@ Ita-nia mudansa la armazenadu seidauk!",
 'contribslink' => 'kontribuisaun',
 'block-log-flags-nocreate' => 'la bele kria konta foun',
 'block-log-flags-noemail' => 'korreiu eletróniku blokeiu',
+'block-log-flags-nousertalk' => 'la bele edita pájina diskusaun rasik',
 'ipb_already_blocked' => 'Ema ruma blokeiu "$1" tiha ona',
 
 # Move page
index a3b9bba..b726e80 100644 (file)
@@ -1003,6 +1003,7 @@ HTML tags جانچئے.',
 'uploadlogpagetext' => 'درج ذیل میں حالیہ زبراثقال (اپ لوڈ) کی گئی املاف (فائلوں) کی فہرست دی گئی ہے۔',
 'filedesc' => 'خلاصہ',
 'fileuploadsummary' => 'خلاصہ :',
+'filesource' => 'ذرائع',
 'uploadedfiles' => 'زبراثقال ملف (فائل اپ لوڈ)',
 'ignorewarning' => 'انتباہ نظرانداز کرتے ہوۓ بہرصورت ملف (فائل) کو محفوظ کرلیا جاۓ۔',
 'ignorewarnings' => 'ہر انتباہ نظرانداز کردیا جاۓ۔',
index 6ffc145..f363c3f 100644 (file)
--- a/load.php
+++ b/load.php
@@ -24,6 +24,7 @@
 
 // Bail if PHP is too low
 if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
+       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
        wfPHPVersionError( 'load.php' );
 }
index 6da5815..69d1131 100644 (file)
@@ -20,8 +20,9 @@
  * @defgroup Maintenance Maintenance
  */
 
-// Make sure we're on PHP5 or better
+// Make sure we're on PHP5.3.2 or better
 if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
+       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
        wfPHPVersionError( 'cli' );
 }
@@ -37,7 +38,6 @@ define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless
 
 $maintClass = false;
 
-
 /**
  * Abstract maintenance class for quickly writing and churning out
  * maintenance scripts with minimal effort. All that _must_ be defined
index ae28567..e369cb1 100644 (file)
@@ -56,12 +56,9 @@ class ImportSiteScripts extends Maintenance {
                        }
 
                        $this->output( "Importing $page\n" );
-                       $uri = new Uri( $baseUrl );
-                       $uri->extendQuery( array(
+                       $url = wfAppendQuery( $baseUrl, array(
                                'action' => 'raw',
                                'title' => "MediaWiki:{$page}" ) );
-                       $url = $uri->toString();
-
                        $text = Http::get( $url );
 
                        $wikiPage = WikiPage::factory( $title );
@@ -82,9 +79,7 @@ class ImportSiteScripts extends Maintenance {
                $pages = array();
 
                do {
-                       $uri = new Uri( $baseUrl );
-                       $uri->extendQuery( $data );
-                       $url = $uri->toString();
+                       $url = wfAppendQuery( $baseUrl, $data );
                        $strResult = Http::get( $url );
                        //$result = FormatJson::decode( $strResult ); // Still broken
                        $result = unserialize( $strResult );
index 2d0f90f..1324bd7 100644 (file)
@@ -189,6 +189,7 @@ $wgIgnoredMessages = array(
        'wantedtemplates-summary',
        'activeusers-summary',
        'search-summary',
+       'editpage-head-copy-warn',
        'editpage-tos-summary',
        'addsection-preload',
        'addsection-editintro',
index 33c104b..71beec6 100644 (file)
@@ -653,6 +653,7 @@ $wgMessageStructure = array(
                'yourdiff',
                'copyrightwarning',
                'copyrightwarning2',
+               'editpage-head-copy-warn',
                'editpage-tos-summary',
                'longpage-hint',
                'longpageerror',
index 5a24355..82ab718 100644 (file)
@@ -204,6 +204,10 @@ return array(
                'scripts' => 'resources/jquery/jquery.spinner.js',
                'styles' => 'resources/jquery/jquery.spinner.css',
        ),
+       'jquery.jStorage' => array(
+               'scripts' => 'resources/jquery/jquery.jStorage.js',
+               'dependencies' => 'jquery.json',
+       ),
        'jquery.suggestions' => array(
                'scripts' => 'resources/jquery/jquery.suggestions.js',
                'styles' => 'resources/jquery/jquery.suggestions.css',
diff --git a/resources/jquery/jquery.jStorage.js b/resources/jquery/jquery.jStorage.js
new file mode 100644 (file)
index 0000000..95959cf
--- /dev/null
@@ -0,0 +1,532 @@
+/*
+ * ----------------------------- JSTORAGE -------------------------------------
+ * Simple local storage wrapper to save data on the browser side, supporting
+ * all major browsers - IE6+, Firefox2+, Safari4+, Chrome4+ and Opera 10.5+
+ *
+ * Copyright (c) 2010 Andris Reinman, andris.reinman@gmail.com
+ * Project homepage: www.jstorage.info
+ *
+ * Taken from Github with slight modifications by Hoo man
+ * https://raw.github.com/andris9/jStorage/master/jstorage.js
+ *
+ * Licensed under MIT-style license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * $.jStorage
+ *
+ * USAGE:
+ *
+ * jStorage requires Prototype, MooTools or jQuery! If jQuery is used, then
+ * jQuery-JSON (http://code.google.com/p/jquery-json/) is also needed.
+ * (jQuery-JSON needs to be loaded BEFORE jStorage!)
+ *
+ * Methods:
+ *
+ * -set(key, value[, options])
+ * $.jStorage.set(key, value) -> saves a value
+ *
+ * -get(key[, default])
+ * value = $.jStorage.get(key [, default]) ->
+ *    retrieves value if key exists, or default if it doesn't
+ *
+ * -deleteKey(key)
+ * $.jStorage.deleteKey(key) -> removes a key from the storage
+ *
+ * -flush()
+ * $.jStorage.flush() -> clears the cache
+ *
+ * -storageObj()
+ * $.jStorage.storageObj() -> returns a read-ony copy of the actual storage
+ *
+ * -storageSize()
+ * $.jStorage.storageSize() -> returns the size of the storage in bytes
+ *
+ * -index()
+ * $.jStorage.index() -> returns the used keys as an array
+ *
+ * -storageAvailable()
+ * $.jStorage.storageAvailable() -> returns true if storage is available
+ *
+ * -reInit()
+ * $.jStorage.reInit() -> reloads the data from browser storage
+ *
+ * <value> can be any JSON-able value, including objects and arrays.
+ *
+ **/
+
+(function($){
+    if(!$ || !($.toJSON || Object.toJSON || window.JSON)){
+        throw new Error("jQuery, MooTools or Prototype needs to be loaded before jStorage!");
+    }
+
+    var
+        /* This is the object, that holds the cached values */
+        _storage = {},
+
+        /* Actual browser storage (localStorage or globalStorage['domain']) */
+        _storage_service = {jStorage:"{}"},
+
+        /* DOM element for older IE versions, holds userData behavior */
+        _storage_elm = null,
+
+        /* How much space does the storage take */
+        _storage_size = 0,
+
+        /* function to encode objects to JSON strings */
+        json_encode = $.toJSON || Object.toJSON || (window.JSON && (JSON.encode || JSON.stringify)),
+
+        /* function to decode objects from JSON strings */
+        json_decode = $.evalJSON || (window.JSON && (JSON.decode || JSON.parse)) || function(str){
+            return String(str).evalJSON();
+        },
+
+        /* which backend is currently used */
+        _backend = false,
+
+        /* Next check for TTL */
+        _ttl_timeout,
+
+        /**
+         * XML encoding and decoding as XML nodes can't be JSON'ized
+         * XML nodes are encoded and decoded if the node is the value to be saved
+         * but not if it's as a property of another object
+         * Eg. -
+         *   $.jStorage.set("key", xmlNode);        // IS OK
+         *   $.jStorage.set("key", {xml: xmlNode}); // NOT OK
+         */
+        _XMLService = {
+
+            /**
+             * Validates a XML node to be XML
+             * based on jQuery.isXML function
+             */
+            isXML: function(elm){
+                var documentElement = (elm ? elm.ownerDocument || elm : 0).documentElement;
+                return documentElement ? documentElement.nodeName !== "HTML" : false;
+            },
+
+            /**
+             * Encodes a XML node to string
+             * based on http://www.mercurytide.co.uk/news/article/issues-when-working-ajax/
+             */
+            encode: function(xmlNode) {
+                if(!this.isXML(xmlNode)){
+                    return false;
+                }
+                try{ // Mozilla, Webkit, Opera
+                    return new XMLSerializer().serializeToString(xmlNode);
+                }catch(E1) {
+                    try {  // IE
+                        return xmlNode.xml;
+                    }catch(E2){}
+                }
+                return false;
+            },
+
+            /**
+             * Decodes a XML node from string
+             * loosely based on http://outwestmedia.com/jquery-plugins/xmldom/
+             */
+            decode: function(xmlString){
+                var dom_parser = ("DOMParser" in window && (new DOMParser()).parseFromString) ||
+                        (window.ActiveXObject && function(_xmlString) {
+                    var xml_doc = new ActiveXObject('Microsoft.XMLDOM');
+                    xml_doc.async = 'false';
+                    xml_doc.loadXML(_xmlString);
+                    return xml_doc;
+                }),
+                resultXML;
+                if(!dom_parser){
+                    return false;
+                }
+                resultXML = dom_parser.call("DOMParser" in window && (new DOMParser()) || window, xmlString, 'text/xml');
+                return this.isXML(resultXML)?resultXML:false;
+            }
+        };
+
+    ////////////////////////// PRIVATE METHODS ////////////////////////
+
+    /**
+     * Initialization function. Detects if the browser supports DOM Storage
+     * or userData behavior and behaves accordingly.
+     * @returns undefined
+     */
+    function _init(){
+        /* Check if browser supports localStorage */
+        var localStorageReallyWorks = false;
+        if("localStorage" in window){
+            try {
+                window.localStorage.setItem('_tmptest', 'tmpval');
+                localStorageReallyWorks = true;
+                window.localStorage.removeItem('_tmptest');
+            } catch(BogusQuotaExceededErrorOnIos5) {
+                // Thanks be to iOS5 Private Browsing mode which throws
+                // QUOTA_EXCEEDED_ERRROR DOM Exception 22.
+            }
+        }
+        if(localStorageReallyWorks){
+            try {
+                if(window.localStorage) {
+                    _storage_service = window.localStorage;
+                    _backend = "localStorage";
+                }
+            } catch(E3) {/* Firefox fails when touching localStorage and cookies are disabled */}
+        }
+        /* Check if browser supports globalStorage */
+        else if("globalStorage" in window){
+            try {
+                if(window.globalStorage) {
+                    _storage_service = window.globalStorage[window.location.hostname];
+                    _backend = "globalStorage";
+                }
+            } catch(E4) {/* Firefox fails when touching localStorage and cookies are disabled */}
+        }
+        /* Check if browser supports userData behavior */
+        else {
+            _storage_elm = document.createElement('link');
+            if(_storage_elm.addBehavior){
+
+                /* Use a DOM element to act as userData storage */
+                _storage_elm.style.behavior = 'url(#default#userData)';
+
+                /* userData element needs to be inserted into the DOM! */
+                document.getElementsByTagName('head')[0].appendChild(_storage_elm);
+
+                _storage_elm.load("jStorage");
+                var data = "{}";
+                try{
+                    data = _storage_elm.getAttribute("jStorage");
+                }catch(E5){}
+                _storage_service.jStorage = data;
+                _backend = "userDataBehavior";
+            }else{
+                _storage_elm = null;
+                return;
+            }
+        }
+
+        _load_storage();
+
+        // remove dead keys
+        _handleTTL();
+    }
+
+    /**
+     * Loads the data from the storage based on the supported mechanism
+     * @returns undefined
+     */
+    function _load_storage(){
+        /* if jStorage string is retrieved, then decode it */
+        if(_storage_service.jStorage){
+            try{
+                _storage = json_decode(String(_storage_service.jStorage));
+            }catch(E6){_storage_service.jStorage = "{}";}
+        }else{
+            _storage_service.jStorage = "{}";
+        }
+        _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;
+    }
+
+    /**
+     * This functions provides the "save" mechanism to store the jStorage object
+     * @returns undefined
+     */
+    function _save(){
+        try{
+            _storage_service.jStorage = json_encode(_storage);
+            // If userData is used as the storage engine, additional
+            if(_storage_elm) {
+                _storage_elm.setAttribute("jStorage",_storage_service.jStorage);
+                _storage_elm.save("jStorage");
+            }
+            _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;
+        }catch(E7){/* probably cache is full, nothing is saved this way*/}
+    }
+
+    /**
+     * Function checks if a key is set and is string or numberic
+     */
+    function _checkKey(key){
+        if(!key || (typeof key !== "string" && typeof key !== "number")){
+            throw new TypeError('Key name must be string or numeric');
+        }
+        if(key === "__jstorage_meta"){
+            throw new TypeError('Reserved key name');
+        }
+        return true;
+    }
+
+    /**
+     * Removes expired keys
+     */
+    function _handleTTL(){
+        var curtime, i, TTL, nextExpire = Infinity, changed = false;
+
+        clearTimeout(_ttl_timeout);
+
+        if(!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL !== "object"){
+            // nothing to do here
+            return;
+        }
+
+        curtime = +new Date();
+        TTL = _storage.__jstorage_meta.TTL;
+        for(i in TTL){
+            if(TTL.hasOwnProperty(i)){
+                if(TTL[i] <= curtime){
+                    delete TTL[i];
+                    delete _storage[i];
+                    changed = true;
+                }else if(TTL[i] < nextExpire){
+                    nextExpire = TTL[i];
+                }
+            }
+        }
+
+        // set next check
+        if(nextExpire != Infinity){
+            _ttl_timeout = setTimeout(_handleTTL, nextExpire - curtime);
+        }
+
+        // save changes
+        if(changed){
+            _save();
+        }
+    }
+
+    ////////////////////////// PUBLIC INTERFACE /////////////////////////
+
+    $.jStorage = {
+        /* Version number */
+        version: "0.1.7.0",
+
+        /**
+         * Sets a key's value.
+         *
+         * @param {String} key - Key to set. If this value is not set or not
+         *              a string an exception is raised.
+         * @param {Mixed} value - Value to set. This can be any value that is JSON
+         *              compatible (Numbers, Strings, Objects etc.).
+         * @param {Object} [options] - possible options to use
+         * @param {Number} [options.TTL] - optional TTL value
+         * @returns the used value
+         */
+        set: function(key, value, options){
+            _checkKey(key);
+
+            options = options || {};
+
+            if(_XMLService.isXML(value)){
+                value = {_is_xml:true,xml:_XMLService.encode(value)};
+            }else if(typeof value === "function"){
+                value = null; // functions can't be saved!
+            }else if(value && typeof value === "object"){
+                // clone the object before saving to _storage tree
+                value = json_decode(json_encode(value));
+            }
+            _storage[key] = value;
+
+            if(!isNaN(options.TTL)){
+                this.setTTL(key, options.TTL);
+                // also handles saving
+            }else{
+                _save();
+            }
+            return value;
+        },
+
+        /**
+         * Looks up a key in cache
+         *
+         * @param {String} key - Key to look up.
+         * @param {mixed} def - Default value to return, if key didn't exist.
+         * @returns the key value, default value or <null>
+         */
+        get: function(key, def){
+            _checkKey(key);
+            if(key in _storage){
+                if(_storage[key] && typeof _storage[key] === "object" &&
+                        _storage[key]._is_xml &&
+                            _storage[key]._is_xml){
+                    return _XMLService.decode(_storage[key].xml);
+                }else{
+                    return _storage[key];
+                }
+            }
+            return typeof(def) === 'undefined' ? null : def;
+        },
+
+        /**
+         * Deletes a key from cache.
+         *
+         * @param {String} key - Key to delete.
+         * @returns true if key existed or false if it didn't
+         */
+        deleteKey: function(key){
+            _checkKey(key);
+            if(key in _storage){
+                delete _storage[key];
+                // remove from TTL list
+                if(_storage.__jstorage_meta &&
+                  typeof _storage.__jstorage_meta.TTL === "object" &&
+                  key in _storage.__jstorage_meta.TTL){
+                    delete _storage.__jstorage_meta.TTL[key];
+                }
+                _save();
+                return true;
+            }
+            return false;
+        },
+
+        /**
+         * Sets a TTL for a key, or remove it if ttl value is 0 or below
+         *
+         * @param {String} key - key to set the TTL for
+         * @param {Number} ttl - TTL timeout in milliseconds
+         * @returns true if key existed or false if it didn't
+         */
+        setTTL: function(key, ttl){
+            var curtime = +new Date();
+            _checkKey(key);
+            ttl = Number(ttl) || 0;
+            if(key in _storage){
+
+                if(!_storage.__jstorage_meta){
+                    _storage.__jstorage_meta = {};
+                }
+                if(!_storage.__jstorage_meta.TTL){
+                    _storage.__jstorage_meta.TTL = {};
+                }
+
+                // Set TTL value for the key
+                if(ttl>0){
+                    _storage.__jstorage_meta.TTL[key] = curtime + ttl;
+                }else{
+                    delete _storage.__jstorage_meta.TTL[key];
+                }
+
+                _save();
+
+                _handleTTL();
+                return true;
+            }
+            return false;
+        },
+
+        /**
+         * Deletes everything in cache.
+         *
+         * @return true
+         */
+        flush: function(){
+            _storage = {};
+            _save();
+            return true;
+        },
+
+        /**
+         * Returns a read-only copy of _storage
+         *
+         * @returns Object
+        */
+        storageObj: function(){
+            function F() {}
+            F.prototype = _storage;
+            return new F();
+        },
+
+        /**
+         * Returns an index of all used keys as an array
+         * ['key1', 'key2',..'keyN']
+         *
+         * @returns Array
+        */
+        index: function(){
+            var index = [], i;
+            for(i in _storage){
+                if(_storage.hasOwnProperty(i) && i !== "__jstorage_meta"){
+                    index.push(i);
+                }
+            }
+            return index;
+        },
+
+        /**
+         * How much space in bytes does the storage take?
+         *
+         * @returns Number
+         */
+        storageSize: function(){
+            return _storage_size;
+        },
+
+        /**
+         * Which backend is currently in use?
+         *
+         * @returns String
+         */
+        currentBackend: function(){
+            return _backend;
+        },
+
+        /**
+         * Test if storage is available
+         *
+         * @returns Boolean
+         */
+        storageAvailable: function(){
+            return !!_backend;
+        },
+
+        /**
+         * Reloads the data from browser storage
+         *
+         * @returns undefined
+         */
+        reInit: function(){
+            var new_storage_elm, data;
+            if(_storage_elm && _storage_elm.addBehavior){
+                new_storage_elm = document.createElement('link');
+
+                _storage_elm.parentNode.replaceChild(new_storage_elm, _storage_elm);
+                _storage_elm = new_storage_elm;
+
+                /* Use a DOM element to act as userData storage */
+                _storage_elm.style.behavior = 'url(#default#userData)';
+
+                /* userData element needs to be inserted into the DOM! */
+                document.getElementsByTagName('head')[0].appendChild(_storage_elm);
+
+                _storage_elm.load("jStorage");
+                data = "{}";
+                try{
+                    data = _storage_elm.getAttribute("jStorage");
+                }catch(E5){}
+                _storage_service.jStorage = data;
+                _backend = "userDataBehavior";
+            }
+
+            _load_storage();
+        }
+    };
+
+    // Initialize jStorage
+    _init();
+
+})(window.$ || window.jQuery);
index e47b35f..5461309 100644 (file)
@@ -67,7 +67,7 @@ class StandardTemplate extends LegacyTemplate {
                wfProfileOut( __METHOD__ . '-1' );
                wfProfileIn( __METHOD__ . '-2' );
                $l = $this->getSkin()->getLanguage()->alignStart();
-               $s .= "<td class='bottom' align='$l' valign='top'>";
+               $s .= "<td class='bottom' style='text-align: $l; vertical-align: top;'>";
 
                $s .= $this->bottomLinks();
                $s .= "\n<br />" . $this->getSkin()->getLanguage()->pipeList( array(
index e853b13..cb5ca36 100644 (file)
@@ -13,7 +13,6 @@ $wgAutoloadClasses += array(
 
        //includes
        'BlockTest' => "$testFolder/phpunit/includes/BlockTest.php",
-       'MockOutputPage' => "$testFolder/phpunit/includes/MockOutputPage.php",
 
        //API
        'ApiFormatTestBase' => "$testFolder/phpunit/includes/api/format/ApiFormatTestBase.php",
index 746add5..9097d30 100644 (file)
@@ -108,7 +108,7 @@ class GlobalTest extends MediaWikiTestCase {
                        array( array( 'foo' => 1 ), 'foo=1' ), // number test
                        array( array( 'foo' => true ), 'foo=1' ), // true test
                        array( array( 'foo' => false ), '' ), // false test
-                       array( array( 'foo' => null ), 'foo' ), // null test
+                       array( array( 'foo' => null ), '' ), // null test
                        array( array( 'foo' => 'A&B=5+6@!"\'' ), 'foo=A%26B%3D5%2B6%40%21%22%27' ), // urlencoding test
                        array( array( 'foo' => 'bar', 'baz' => 'is', 'asdf' => 'qwerty' ), 'foo=bar&baz=is&asdf=qwerty' ), // multi-item test
                        array( array( 'foo' => array( 'bar' => 'baz' ) ), 'foo%5Bbar%5D=baz' ),
@@ -311,7 +311,7 @@ class GlobalTest extends MediaWikiTestCase {
        
        function testDebugFunctionTest() {
        
-               global $wgDebugLogFile, $wgOut, $wgShowDebug, $wgDebugTimestamps;
+               global $wgDebugLogFile, $wgDebugTimestamps;
                
                $old_log_file = $wgDebugLogFile;
                $wgDebugLogFile = tempnam( wfTempDir(), 'mw-' );
@@ -333,33 +333,7 @@ class GlobalTest extends MediaWikiTestCase {
                wfDebug( "\00305This has böth UTF and control chars\003" );
                $this->assertEquals( " 05This has böth UTF and control chars ", file_get_contents( $wgDebugLogFile ) );
                unlink( $wgDebugLogFile );
-               
-               
-               
-               $old_wgOut = $wgOut;
-               $old_wgShowDebug = $wgShowDebug;
-               
-               $wgOut = new MockOutputPage;
-               
-               $wgShowDebug = true;
-               
-               $message = "\00305This has böth UTF and control chars\003";
-               
-               wfDebug( $message );
-               
-               if( $wgOut->message == "JAJA is a stupid error message. Anyway, here's your message: $message" ) {
-                       $this->assertTrue( true, 'MockOutputPage called, set the proper message.' );
-               }
-               else {
-                       $this->assertTrue( false, 'MockOutputPage was not called.' );
-               }
-               
-               $wgOut = $old_wgOut;
-               $wgShowDebug = $old_wgShowDebug;                
-               unlink( $wgDebugLogFile );
-               
-               
-               
+
                wfDebugMem();
                $this->assertGreaterThan( 5000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) );
                unlink( $wgDebugLogFile );
diff --git a/tests/phpunit/includes/MockOutputPage.php b/tests/phpunit/includes/MockOutputPage.php
deleted file mode 100644 (file)
index bdee483..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-class MockOutputPage {
-
-       public $message;
-
-       function debug( $message ) {
-               $this->message = "JAJA is a stupid error message. Anyway, here's your message: $message";
-       }
-}
diff --git a/tests/phpunit/includes/UriTest.php b/tests/phpunit/includes/UriTest.php
deleted file mode 100644 (file)
index 3b78f47..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-
-class UriTest extends MediaWikiTestCase {
-
-       function setUp() {
-               AutoLoader::loadClass( 'Uri' );
-       }
-
-       function dataUris() {
-               return array(
-                       array(
-                               'http://example.com/',
-                               array(
-                                       'scheme'    => 'http',
-                                       'delimiter' => '://',
-                                       'user'      => null,
-                                       'pass'      => null,
-                                       'host'      => 'example.com',
-                                       'port'      => null,
-                                       'path'      => '/',
-                                       'query'     => null,
-                                       'fragment'  => null,
-                               ),
-                       ),
-                       array(
-                               '//mediawiki.org/wiki/Main_Page',
-                               array(
-                                       'scheme'    => null,
-                                       'delimiter' => '//',
-                                       'user'      => null,
-                                       'pass'      => null,
-                                       'host'      => 'mediawiki.org',
-                                       'port'      => null,
-                                       'path'      => '/wiki/Main_Page',
-                                       'query'     => null,
-                                       'fragment'  => null,
-                               ),
-                       ),
-                       array(
-                               'http://user:pass@example.com/',
-                               array(
-                                       'scheme'    => 'http',
-                                       'delimiter' => '://',
-                                       'user'      => 'user',
-                                       'pass'      => 'pass',
-                                       'host'      => 'example.com',
-                                       'port'      => null,
-                                       'path'      => '/',
-                                       'query'     => null,
-                                       'fragment'  => null,
-                               ),
-                       ),
-                       array(
-                               '/?asdf=asdf',
-                               array(
-                                       'scheme'    => null,
-                                       'delimiter' => null,
-                                       'user'      => null,
-                                       'pass'      => null,
-                                       'host'      => null,
-                                       'port'      => null,
-                                       'path'      => '/',
-                                       'query'     => 'asdf=asdf',
-                                       'fragment'  => null,
-                               ),
-                       ),
-                       array(
-                               '?asdf=asdf#asdf',
-                               array(
-                                       'scheme'    => null,
-                                       'delimiter' => null,
-                                       'user'      => null,
-                                       'pass'      => null,
-                                       'host'      => null,
-                                       'port'      => null,
-                                       'path'      => null,
-                                       'query'     => 'asdf=asdf',
-                                       'fragment'  => 'asdf',
-                               ),
-                       )
-               );
-       }
-
-       /**
-        * Ensure that get* methods properly match the appropriate getComponent( key ) value
-        * @dataProvider dataUris
-        */
-       function testGetters( $uri ) {
-               $uri = new Uri( $uri );
-               $getterMap = array(
-                       'getProtocol' => 'scheme',
-                       'getUser' => 'user',
-                       'getPassword' => 'pass',
-                       'getHost' => 'host',
-                       'getPort' => 'port',
-                       'getPath' => 'path',
-                       'getQueryString' => 'query',
-                       'getFragment' => 'fragment',
-               );
-               foreach ( $getterMap as $fn => $c ) {
-                       $this->assertSame( $uri->{$fn}(), $uri->getComponent( $c ), "\$uri->{$fn}(); matches \$uri->getComponent( '$c' );" );
-               }
-       }
-
-       /**
-        * Ensure that Uri has the proper components for our example uris
-        * @dataProvider dataUris
-        */
-       function testComponents( $uri, $components ) {
-               $uri = new Uri( $uri );
-
-               $this->assertSame( $components['scheme'], $uri->getProtocol(), 'Correct scheme' );
-               $this->assertSame( $components['delimiter'], $uri->getDelimiter(), 'Correct delimiter' );
-               $this->assertSame( $components['user'], $uri->getUser(), 'Correct user' );
-               $this->assertSame( $components['pass'], $uri->getPassword(), 'Correct pass' );
-               $this->assertSame( $components['host'], $uri->getHost(), 'Correct host' );
-               $this->assertSame( $components['port'], $uri->getPort(), 'Correct port' );
-               $this->assertSame( $components['path'], $uri->getPath(), 'Correct path' );
-               $this->assertSame( $components['query'], $uri->getQueryString(), 'Correct query' );
-               $this->assertSame( $components['fragment'], $uri->getFragment(), 'Correct fragment' );
-       }
-
-       /**
-        * Ensure that the aliases work for various components.
-        */
-       function testAliases() {
-               $url = "//myuser@test.com";
-               $uri = new Uri( $url );
-
-               // Set the aliases.
-               $uri->setComponent( 'protocol', 'https' );
-               $uri->setComponent( 'password', 'mypass' );
-
-               // Now try getting them.
-               $this->assertSame( 'https', $uri->getComponent( 'protocol' ), 'Correct protocol (alias for scheme)' );
-               $this->assertSame( 'mypass', $uri->getComponent( 'password' ), 'Correct password (alias for pass)' );
-
-               // Finally check their actual names.
-               $this->assertSame( 'https', $uri->getProtocol(), 'Alias for scheme works' );
-               $this->assertSame( 'mypass', $uri->getPassword(), 'Alias for pass works' );
-       }
-
-       /**
-        * Ensure that Uri's helper methods return the correct data
-        */
-       function testHelpers() {
-               $uri = new Uri( 'http://a:b@example.com:8080/path?query=value' );
-
-               $this->assertSame( 'a:b', $uri->getUserInfo(), 'Correct getUserInfo' );
-               $this->assertSame( 'example.com:8080', $uri->getHostPort(), 'Correct getHostPort' );
-               $this->assertSame( 'a:b@example.com:8080', $uri->getAuthority(), 'Correct getAuthority' );
-               $this->assertSame( '/path?query=value', $uri->getRelativePath(), 'Correct getRelativePath' );
-               $this->assertSame( 'http://a:b@example.com:8080/path?query=value', $uri->toString(), 'Correct toString' );
-       }
-
-       /**
-        * Ensure that Uri's extend method properly overrides keys
-        */
-       function testExtend() {
-               $uri = new Uri( 'http://example.org/?a=b&hello=world' );
-               $uri->extendQuery( 'a=c&foo=bar' );
-               $this->assertSame( 'a=c&hello=world&foo=bar', $uri->getQueryString() );
-       }
-}
index d56e632..0df5a46 100644 (file)
@@ -16,9 +16,9 @@ class DatabaseSQLTest extends MediaWikiTestCase {
        }
 
        /**
-        * @dataProvider dataSQL
+        * @dataProvider dataSelectSQLText
         */
-       function testSQL( $sql, $sqlText ) {
+       function testSelectSQLText( $sql, $sqlText ) {
                $this->assertEquals( trim( $this->db->selectSQLText(
                        isset( $sql['tables'] ) ? $sql['tables'] : array(),
                        isset( $sql['fields'] ) ? $sql['fields'] : array(),
@@ -29,7 +29,7 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                ) ), $sqlText );
        }
 
-       function dataSQL() {
+       function dataSelectSQLText() {
                return array(
                        array(
                                array(
@@ -72,4 +72,36 @@ class DatabaseSQLTest extends MediaWikiTestCase {
                        ),
                );
        }
+
+       /**
+        * @dataProvider dataConditional
+        */
+       function testConditional( $sql, $sqlText ) {
+               $this->assertEquals( trim( $this->db->conditional(
+                       $sql['conds'],
+                       $sql['true'],
+                       $sql['false']
+               ) ), $sqlText );
+       }
+
+       function dataConditional() {
+               return array(
+                       array(
+                               array(
+                                       'conds' => array( 'field' => 'text' ),
+                                       'true' => 1,
+                                       'false' => 'NULL',
+                               ),
+                               "(CASE WHEN field = 'text' THEN 1 ELSE NULL END)"
+                       ),
+                       array(
+                               array(
+                                       'conds' => 'field=1',
+                                       'true' => 1,
+                                       'false' => 'NULL',
+                               ),
+                               "(CASE WHEN field=1 THEN 1 ELSE NULL END)"
+                       ),
+               );
+       }
 }
\ No newline at end of file
index 1627c47..246b291 100644 (file)
@@ -12,6 +12,11 @@ class MWDebugTest extends MediaWikiTestCase {
                }
                /** Clear log before each test */
                MWDebug::clearLog();
+               wfSuppressWarnings();
+       }
+
+       function tearDown() {
+               wfRestoreWarnings();
        }
 
        function testAddLog() {
index d4c6165..8307b48 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -71,9 +71,10 @@ function wfThumbHandle404() {
        }
        # Just get the URI path (REDIRECT_URL/REQUEST_URI is either a full URL or a path)
        if ( substr( $uriPath, 0, 1 ) !== '/' ) {
-               $uri = new Uri( $uriPath );
-               $uriPath = $uri->getPath();
-               if ( $uriPath === null ) {
+               $bits = wfParseUrl( $uriPath );
+               if ( $bits && isset( $bits['path'] ) ) {
+                       $uriPath = $bits['path'];
+               } else {
                        wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
                        return;
                }