Merge "Fix Closure detection in MediaWikiTestCase"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 20 May 2017 10:48:43 +0000 (10:48 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 20 May 2017 10:48:43 +0000 (10:48 +0000)
RELEASE-NOTES-1.30
includes/collation/CollationFa.php
includes/installer/MysqlInstaller.php
includes/parser/BlockLevelPass.php
languages/messages/MessagesCa.php
resources/src/mediawiki.legacy/shared.css
tests/parser/parserTests.txt

index b24a08d..fbe23ab 100644 (file)
@@ -40,7 +40,8 @@ production.
 * …
 
 === Bug fixes in 1.30 ===
-* …
+* (T151633) Ordered list items use now Devanagari digits in Nepalese
+  (thanks to Sfic)
 
 === Action API changes in 1.30 ===
 * (T37247) action=parse output will be wrapped in a div with
index 9cce087..f8506d7 100644 (file)
 /**
  * Temporary workaround for incorrect collation of Persian language ('fa') in ICU 52 (bug T139110).
  *
- * All of the following will be considered separate letters for category headings in Persian:
+ * Replace with other letters that appear in an okish spot in the alphabet
+ *
  *  - Characters 'و' 'ا' (often appear at the beginning of words)
  *  - Characters 'ٲ' 'ٳ' (may appear at the beginning of words in loanwords)
- *  - Characters 'ء' 'ئ' (don't appear at the beginning of words, but it's easier to implement)
  *
  * @since 1.29
  */
 class CollationFa extends IcuCollation {
-       private $tertiaryCollator;
+
+       // Really hacky - replace with stuff from other blocks.
+       private $override = [
+               "\xd8\xa7" => "\u{0621}",
+               "\xd9\x88" => "\u{0649}",
+               "\xd9\xb2" => "\xF3\xB3\x80\x81",
+               "\xd9\xb3" => "\xF3\xB3\x80\x82",
+       ];
 
        public function __construct() {
                parent::__construct( 'fa' );
-               $this->tertiaryCollator = Collator::create( 'fa' );
        }
 
-       public function getPrimarySortKey( $string ) {
-               $primary = parent::getPrimarySortKey( $string );
-               // We have to use a tertiary sortkey for everything with the primary sortkey of 2627.
-               // Otherwise, the "Remove duplicate prefixes" logic in IcuCollation would remove them.
-               // This matches sortkeys for the following characters: ء ئ ا و ٲ ٳ
-               if ( substr( $primary, 0, 2 ) === "\x26\x27" ) {
-                       wfDebug( "Using tertiary sortkey for '$string'\n" );
-                       return $this->tertiaryCollator->getSortKey( $string );
+       public function getSortKey( $string ) {
+               $modified = strtr( $string, $this->override );
+               return parent::getSortKey( $modified );
+       }
+
+       public function getFirstLetter( $string ) {
+               if ( isset( $this->override[substr( $string, 0, 2 )] ) ) {
+                       return substr( $string, 0, 2 );
                }
-               return $primary;
+               return parent::getFirstLetter( $string );
        }
 }
index 09051f4..4f0b66c 100644 (file)
@@ -179,8 +179,8 @@ class MysqlInstaller extends DatabaseInstaller {
 
                # Determine existing default character set
                if ( $conn->tableExists( "revision", __METHOD__ ) ) {
-                       $revision = $conn->buildLike( $this->getVar( 'wgDBprefix' ) . 'revision' );
-                       $res = $conn->query( "SHOW TABLE STATUS $revision", __METHOD__ );
+                       $revision = $this->escapeLikeInternal( $this->getVar( 'wgDBprefix' ) . 'revision', '\\' );
+                       $res = $conn->query( "SHOW TABLE STATUS LIKE '$revision'", __METHOD__ );
                        $row = $conn->fetchObject( $res );
                        if ( !$row ) {
                                $this->parent->showMessage( 'config-show-table-status' );
@@ -221,6 +221,16 @@ class MysqlInstaller extends DatabaseInstaller {
                $wgDBpassword = $this->getVar( '_InstallPassword' );
        }
 
+       /**
+        * @param string $s
+        * @return string
+        */
+       protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
+               return str_replace( [ $escapeChar, '%', '_' ],
+                       [ "{$escapeChar}{$escapeChar}", "{$escapeChar}%", "{$escapeChar}_" ],
+                       $s );
+       }
+
        /**
         * Get a list of storage engines that are available and supported
         *
index 2023d13..599fbf6 100644 (file)
@@ -286,14 +286,14 @@ class BlockLevelPass {
                                # @todo consider using a stack for nestable elements like span, table and div
                                $openMatch = preg_match(
                                        '/(?:<table|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|'
-                                               . '<p|<ul|<ol|<dl|<li|<\\/tr|<\\/td|<\\/th)/iS',
+                                               . '<p|<ul|<ol|<dl|<li|<\\/tr|<\\/td|<\\/th)\\b/iS',
                                        $t
                                );
                                $closeMatch = preg_match(
                                        '/(?:<\\/table|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|'
                                                . '<td|<th|<\\/?blockquote|<\\/?div|<hr|<\\/pre|<\\/p|<\\/mw:|'
                                                . Parser::MARKER_PREFIX
-                                               . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS',
+                                               . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)\\b/iS',
                                        $t
                                );
 
index b38287e..3ccd3c4 100644 (file)
@@ -129,20 +129,79 @@ $specialPageAliases = [
 
 $magicWords = [
        'redirect'                  => [ '0', '#REDIRECCIÓ', '#REDIRECCIO', '#REDIRECT' ],
-       'numberofarticles'          => [ '1', 'NOMBRED\'ARTICLES', 'NUMBEROFARTICLES' ],
-       'numberoffiles'             => [ '1', 'NOMBRED\'ARXIUS', 'NUMBEROFFILES' ],
-       'numberofusers'             => [ '1', 'NOMBRED\'USUARIS', 'NUMBEROFUSERS' ],
-       'numberofedits'             => [ '1', 'NOMBRED\'EDICIONS', 'NUMBEROFEDITS' ],
-       'pagename'                  => [ '1', 'NOMDELAPLANA', 'PAGENAME' ],
+       'notoc'                     => [ '0', '__CAPTAULA__', '__NOTAULA__', '__NOTOC__' ],
+       'nogallery'                 => [ '0', '__CAPGALERIA__', '__NOGALERIA__', '__NOGALLERY__' ],
+       'forcetoc'                  => [ '0', '__FORÇATAULA__', '__FORCETOC__' ],
+       'toc'                       => [ '0', '__TAULA__', '__RESUM__', '__TDM__', '__TOC__' ],
+       'noeditsection'             => [ '0', '__SECCIÓNOEDITABLE__', '__SECCIONOEDITABLE__', '__NOEDITSECTION__' ],
+       'currentmonth'              => [ '1', 'MESACTUAL', 'CURRENTMONTH', 'CURRENTMONTH2' ],
+       'currentmonthname'          => [ '1', 'NOMMESACTUAL', 'CURRENTMONTHNAME' ],
+       'currentmonthnamegen'       => [ '1', 'NOMGENMESACTUAL', 'CURRENTMONTHNAMEGEN' ],
+       'currentmonthabbrev'        => [ '1', 'ABREVMESACTUAL', 'CURRENTMONTHABBREV' ],
+       'currentday'                => [ '1', 'DIAACTUAL', 'CURRENTDAY' ],
+       'currentday2'               => [ '1', 'DIAACTUAL2', 'CURRENTDAY2' ],
+       'currentdayname'            => [ '1', 'NOMDIAACTUAL', 'CURRENTDAYNAME' ],
+       'currentyear'               => [ '1', 'ANYACTUAL', 'CURRENTYEAR' ],
+       'currenttime'               => [ '1', 'HORARICTUAL', 'CURRENTTIME' ],
+       'currenthour'               => [ '1', 'HORAACTUAL', 'CURRENTHOUR' ],
+       'localmonth'                => [ '1', 'MESLOCAL', 'LOCALMONTH', 'LOCALMONTH2' ],
+       'localmonthname'            => [ '1', 'NOMMESLOCAL', 'LOCALMONTHNAME' ],
+       'localmonthnamegen'         => [ '1', 'NOMGENMESLOCAL', 'LOCALMONTHNAMEGEN' ],
+       'localmonthabbrev'          => [ '1', 'ABREVMESLOCAL', 'LOCALMONTHABBREV' ],
+       'localday'                  => [ '1', 'DIALOCAL', 'LOCALDAY' ],
+       'localday2'                 => [ '1', 'DIALOCAL2', 'LOCALDAY2' ],
+       'localdayname'              => [ '1', 'NOMDIALOCAL', 'LOCALDAYNAME' ],
+       'localyear'                 => [ '1', 'ANYLOCAL', 'LOCALYEAR' ],
+       'localtime'                 => [ '1', 'HORARILOCAL', 'LOCALTIME' ],
+       'localhour'                 => [ '1', 'HORALOCAL', 'LOCALHOUR' ],
+       'numberofarticles'          => [ '1', 'NOMBREARTICLES', 'NOMBRED\'ARTICLES', 'NUMBEROFARTICLES' ],
+       'numberoffiles'             => [ '1', 'NOMBREFITXERS', 'NOMBRED\'ARXIUS', 'NUMBEROFFILES' ],
+       'numberofusers'             => [ '1', 'NOMBREUSUARIS', 'NOMBRED\'USUARIS', 'NUMBEROFUSERS' ],
+       'numberofedits'             => [ '1', 'NOMBREEDICIONS', 'NOMBRED\'EDICIONS', 'NUMBEROFEDITS' ],
+       'pagename'                  => [ '1', 'NOMPÀGINA', 'NOMPAGINA', 'NOMDELAPLANA', 'PAGENAME' ],
+       'img_thumbnail'             => [ '1', 'miniatura', 'thumb', 'thumbnail' ],
+       'img_manualthumb'           => [ '1', 'miniatura=$1', 'thumbnail=$1', 'thumb=$1' ],
        'img_right'                 => [ '1', 'dreta', 'right' ],
        'img_left'                  => [ '1', 'esquerra', 'left' ],
+       'img_none'                  => [ '1', 'cap', 'none' ],
+       'img_width'                 => [ '1', '$1px' ],
+       'img_center'                => [ '1', 'center', 'centre' ],
+       'img_framed'                => [ '1', 'marc', 'frame', 'framed', 'enframed' ],
+       'img_frameless'             => [ '1', 'sense marc', 'frameless' ],
+       'img_lang'                  => [ '1', 'lang=$1', 'llengua=$1', 'idioma=$1' ],
+       'img_page'                  => [ '1', 'pàgina=$1', 'pàgina $1', 'page=$1', 'page $1' ],
+       'img_upright'               => [ '1', 'redreçat', 'upright', 'redreçat=$1', 'upright=$1', 'redreçat $1', 'upright $1' ],
        'img_border'                => [ '1', 'vora', 'border' ],
+       'img_baseline'              => [ '1', 'línia de base', 'baseline' ],
+       'img_sub'                   => [ '1', 'sub' ],
+       'img_super'                 => [ '1', 'super', 'sup' ],
+       'img_top'                   => [ '1', 'dalt', 'top' ],
+       'img_text_top'              => [ '1', 'dalt-text', 'text-top' ],
+       'img_middle'                => [ '1', 'mitjà', 'middle' ],
+       'img_bottom'                => [ '1', 'baix', 'bottom' ],
+       'img_text_bottom'           => [ '1', 'baix-text', 'text-bottom' ],
        'img_link'                  => [ '1', 'enllaç=$1', 'link=$1' ],
-       'displaytitle'              => [ '1', 'TÍTOL', 'DISPLAYTITLE' ],
-       'language'                  => [ '0', '#IDIOMA:', '#LANGUAGE:' ],
+       'img_alt'                   => [ '1', 'alt=$1' ],
+       'img_class'                 => [ '1', 'class=$1' ],
+       'displaytitle'              => [ '1', 'TÍTOL', 'TITOL', 'DISPLAYTITLE' ],
+       'currentversion'            => [ '1', 'VERSIÓACTUAL', 'VERSIOACTUAL', 'CURRENTVERSION' ],
+       'language'                  => [ '0', '#IDIOMA:', '#LLENGUA:', '#LANGUAGE:' ],
+       'contentlanguage'           => [ '1', 'IDIOMACONTINGUT', 'LLENGUACONTINGUT', 'CONTENTLANGUAGE', 'CONTENTLANG' ],
+       'pagesinnamespace'          => [ '1', 'PÀGINESENESPAINOMS:', 'PAGESINNAMESPACE:', 'PAGESINNS:' ],
+       'numberofadmins'            => [ '1', 'NOMBREADMINS', 'NUMBEROFADMINS' ],
+       'formatnum'                 => [ '0', 'FORMATNOMBRE', 'FORMATNUM' ],
+       'padleft'                   => [ '0', 'SEPARACIÓESQUERRA', 'SEPARACIOESQUERRA', 'PADLEFT' ],
+       'padright'                  => [ '0', 'SEPARACIÓDRETA', 'SEPARACIODRETA', 'PADRIGHT' ],
        'special'                   => [ '0', 'especial', 'special' ],
        'defaultsort'               => [ '1', 'ORDENA:', 'DEFAULTSORT:', 'DEFAULTSORTKEY:', 'DEFAULTCATEGORYSORT:' ],
-       'pagesize'                  => [ '1', 'MIDADELAPLANA', 'PAGESIZE' ],
+       'filepath'                  => [ '0', 'CAMÍ:', 'CAMI:', 'FILEPATH:' ],
+       'tag'                       => [ '0', 'etiqueta', 'marcador', 'tag' ],
+       'hiddencat'                 => [ '1', '__CATAMAGADA__', '__HIDDENCAT__' ],
+       'pagesincategory'           => [ '1', 'PÀGINESENCATEGORIA', 'PAGINESENCATEGORIA', 'PAGINESENCAT', 'PAGESINCATEGORY', 'PAGESINCAT' ],
+       'pagesize'                  => [ '1', 'MIDAPÀGINA', 'MIDAPAGINA', 'MIDADELAPLANA', 'PAGESIZE' ],
+       'noindex'                   => [ '1', '__CAPINDEX__', '__NOINDEX__' ],
+       'staticredirect'            => [ '1', '__REDIRECCIÓESTATICA__', '__REDIRECCIOESTATICA__', '__STATICREDIRECT__' ],
+       'protectionlevel'           => [ '1', 'NIVELLPROTECCIÓ', 'NIVELLPROTECCIO', 'PROTECTIONLEVEL' ],
 ];
 
 $separatorTransformTable = [ ',' => '.', '.' => ',' ];
index 8d7a2a9..8839a2c 100644 (file)
@@ -636,7 +636,8 @@ ol:lang( sdh ) li {
 }
 
 ol:lang( hi ) li,
-ol:lang( mr ) li {
+ol:lang( mr ) li,
+ol:lang( ne ) li {
        list-style-type: -moz-devanagari;
        list-style-type: devanagari;
 }
index 2d107e7..368dc0d 100644 (file)
@@ -17552,10 +17552,10 @@ Sanitizer: Validating that <meta> and <link> work, but only for Microdata
 <p>    <meta itemprop="hello" content="world" />
        &lt;meta http-equiv="refresh" content="5"&gt;
        <meta itemprop="hello" content="5" />
-</p>
        <link itemprop="hello" href="http&#58;//example.org" />
        &lt;link rel="stylesheet" href="<a rel="nofollow" class="external free" href="http://example.org">http://example.org</a>"&gt;
        <link itemprop="hello" href="http&#58;//example.org" />
+</p>
 </div>
 
 !! end