[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-08-20 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

--- Comment #13 from Gerrit Notification Bot gerritad...@wikimedia.org ---
Change 145409 merged by jenkins-bot:
Handle invalid language code gracefully in Language::fetchLanguageNames

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-08-20 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Kunal Mehta (Legoktm) legoktm.wikipe...@gmail.com changed:

   What|Removed |Added

 Status|PATCH_TO_REVIEW |RESOLVED
 CC||legoktm.wikipe...@gmail.com
 Resolution|--- |FIXED
   Target Milestone|--- |1.23.x release
  Flags|Backport_to_Stable? |Backport_to_Stable+

--- Comment #14 from Kunal Mehta (Legoktm) legoktm.wikipe...@gmail.com ---
Backported to the REL1_23 branch.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-08-17 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Andre Klapper aklap...@wikimedia.org changed:

   What|Removed |Added

 CC||gla...@hallowelt.biz,
   ||hexm...@gmail.com

--- Comment #12 from Andre Klapper aklap...@wikimedia.org ---
Backport to 1.23 in https://gerrit.wikimedia.org/r/#/c/145409/ still awaiting
review, and Backport_to_stable flag set 5 weeks ago - someone please decide.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-07-10 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

--- Comment #10 from Gerrit Notification Bot gerritad...@wikimedia.org ---
Change 142974 merged by jenkins-bot:
Handle invalid language code gracefully in Language::fetchLanguageNames

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-07-10 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

--- Comment #11 from Gerrit Notification Bot gerritad...@wikimedia.org ---
Change 145409 had a related patch set uploaded by Martineznovo:
Handle invalid language code gracefully in Language::fetchLanguageNames

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-07-10 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Siebrand Mazeland siebr...@kitano.nl changed:

   What|Removed |Added

 CC||siebr...@kitano.nl
  Flags||Backport_to_Stable?

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-06-29 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Bawolff (Brian Wolff) bawolff...@gmail.com changed:

   What|Removed |Added

 CC||bawolff...@gmail.com

--- Comment #8 from Bawolff (Brian Wolff) bawolff...@gmail.com ---
#
2014-06-29 21:18:24 mw1036 mediawikiwiki: [5f513816]
/wiki/Special:ExpandTemplates   Exception from line 182 of
/usr/local/apache/common-local/php-1.24wmf11/languages/Language.php: Invalid
language code 
#
#0 /usr/local/apache/common-local/php-1.24wmf11/languages/Language.php(161):
Language::newFromCode('')
#
#1 /usr/local/apache/common-local/php-1.24wmf11/includes/Message.php(540):
Language::factory('')
#
#2
/usr/local/apache/common-local/php-1.24wmf11/extensions/Translate/TranslateHooks.php(349):
Message-inLanguage('')
#
#3 [internal function]:
TranslateHooks::translateMessageDocumentationLanguage(Array, '')
#
#4 /usr/local/apache/common-local/php-1.24wmf11/includes/Hooks.php(206):
call_user_func_array('TranslateHooks:...', Array)
#
#5
/usr/local/apache/common-local/php-1.24wmf11/includes/GlobalFunctions.php(4038):
Hooks::run('LanguageGetTran...', Array, NULL)
#
#6 /usr/local/apache/common-local/php-1.24wmf11/languages/Language.php(864):
wfRunHooks('LanguageGetTran...', Array)
#
#7 /usr/local/apache/common-local/php-1.24wmf11/languages/Language.php(914):
Language::fetchLanguageNames('', 'all')
#
#8
/usr/local/apache/common-local/php-1.24wmf11/includes/parser/CoreParserFunctions.php(770):
Language::fetchLanguageName('es', '')
#
#9 [internal function]: CoreParserFunctions::language(Object(Parser), 'es',
'')
#
#10
/usr/local/apache/common-local/php-1.24wmf11/includes/parser/Parser.php(3713):
call_user_func_array(Array, Array)
#
#11
/usr/local/apache/common-local/php-1.24wmf11/includes/parser/Parser.php(3431):
Parser-callParserFunction(Object(PPFrame_DOM), '#language', Array)
#
#12
/usr/local/apache/common-local/php-1.24wmf11/includes/parser/Preprocessor_DOM.php(1175):
Parser-braceSubstitution(Array, Object(PPFrame_DOM))
#
#13
/usr/local/apache/common-local/php-1.24wmf11/includes/parser/Parser.php(3241):
PPFrame_DOM-expand(Object(PPNode_DOM), 0)
#
#14
/usr/local/apache/common-local/php-1.24wmf11/includes/parser/Parser.php(637):
Parser-replaceVariables('{{#language:es|...', false)
#
#15
/usr/local/apache/common-local/php-1.24wmf11/includes/specials/SpecialExpandTemplates.php(89):
Parser-preprocess('{{#language:es|...', Object(Title), Object(ParserOptions))
#
#16
/usr/local/apache/common-local/php-1.24wmf11/includes/specialpage/SpecialPage.php(382):
SpecialExpandTemplates-execute(NULL)
#
#17
/usr/local/apache/common-local/php-1.24wmf11/includes/specialpage/SpecialPageFactory.php(510):
SpecialPage-run(NULL)
#
#18 /usr/local/apache/common-local/php-1.24wmf11/includes/Wiki.php(288):
SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#
#19 /usr/local/apache/common-local/php-1.24wmf11/includes/Wiki.php(603):
MediaWiki-performRequest()
#
#20 /usr/local/apache/common-local/php-1.24wmf11/includes/Wiki.php(452):
MediaWiki-main()
#
#21 /usr/local/apache/common-local/php-1.24wmf11/index.php(46):
MediaWiki-run()
#
#22 /usr/local/apache/common-local/w/index.php(3):
require('/usr/local/apac...')
#
#23 {main}

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-06-29 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Gerrit Notification Bot gerritad...@wikimedia.org changed:

   What|Removed |Added

 Status|NEW |PATCH_TO_REVIEW

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-06-29 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

--- Comment #9 from Gerrit Notification Bot gerritad...@wikimedia.org ---
Change 142974 had a related patch set uploaded by Brian Wolff:
Handle invalid language code gracefully in Language::fetchLanguageNames

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-06-28 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Umherirrender umherirrender_de...@web.de changed:

   What|Removed |Added

 CC||martinezn...@gmail.com

--- Comment #6 from Umherirrender umherirrender_de...@web.de ---
*** Bug 67241 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-06-28 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

--- Comment #7 from Jesús Martínez Novo (Ciencia Al Poder) 
martinezn...@gmail.com ---
From bug 67241:

It throws a Fatal exception of type MWException when for the second parameter
you put some special characters.

Those are what I've tested so far and produce the exception:

   '  : [ ] ( ) / 

Example input that produces the error:

{{#language:es|}}

Crashes just doing a preview on WMF wikis.

I've installed CLDR extension on current master, and it doesn't throw that
error for me. I've tried without caching, with memcache and with database
cache, but I was unable to reproduce the problem.

This seems to be happening on WMF because of some combination of other
extensions or configuration options

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-01-30 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Nemo federicol...@tiscali.it changed:

   What|Removed |Added

   Priority|Unprioritized   |Normal
Summary|HTTP 500 -  |{{#language:code1|code2}}
   |{{#language:code1|code2}}   |should fail gracefully when
   |if code2 contains   |Language::isValidCode or
   |single/double quotes or |stricter is false for code2
   |ampersand   |

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-01-30 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Umherirrender umherirrender_de...@web.de changed:

   What|Removed |Added

 CC||umherirrender_de...@web.de
  Component|ParserFunctions |Parser
Version|unspecified |1.23-git
Product|MediaWiki extensions|MediaWiki

--- Comment #1 from Umherirrender umherirrender_de...@web.de ---
#language parser function is part of core - moving

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-01-30 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

--- Comment #2 from Philippe Verdy verd...@wanadoo.fr ---
Normal priority ?

Aa the Translate extnesion starts being used more widely, along with TNT and
similar templates based on detetion of subpages trying to see if it is the
source (untranslated) page or the translated subpage, we get cases were the
source page to translate contains apostrophe-quotes.

And then we get the HTTP 500 server error. Apostrophe-quotes or double quotes
or ampersands are not uncommon in titles of pages, and these pages, on
multilingual sites like MetaWiki or Commons, will cause such failure.

It is also very easy to reproduce it, and within wikis that use a lot of
utility templates to display various notice banners (which may be translated in
the page's content language detected, #language will crash in those utility
templates.

IF these utility templates are widely used, a user may insert the malicious
code with #template, and could cause LOTS of pages to generate HTTP 500.

These templates will not be easily editable by users that have a preference to
disply immediately a preview on the first edit. Most users visit the template
page to view it alog with its noinclude documentation containing some
examples of rendering of the template. Such visits will crash before the user
can click on the Edit tab.

Avanced users could also try eduting it by inserting the URL with the
?action=edit parameter, but they will also fail if their user preferences
include the preview on the first load of the editor.

The crash may not be easy to detect where it occurs, because it will occur
before hte page is fully expanded and the dependencies are computed and saved,
the page will never be rendered or could only contain the outdated references
to the previous state before the change in some deeply hidden sub-sub-template.

May be the server could implement a crash handler for pages so that they are at
least autocategorized: we could explore the list to determine which
translcluded template or subpage containing #language with bad parameters
causes the crash.

The crash is so easy to reproduce that I fear that now it will be exploited to
generate DoS attacks against servers constantly trying to recover from HTTP 500
crashes by relaunching new instances (with empty caches in memory, each crashes
generates lots of IO on disk and on the database).

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-01-30 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

Umherirrender umherirrender_de...@web.de changed:

   What|Removed |Added

 CC||niklas.laxst...@gmail.com

--- Comment #3 from Umherirrender umherirrender_de...@web.de ---
Needs CLDR extension to reproduce, was added with bug 16699

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-01-30 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

--- Comment #4 from Philippe Verdy verd...@wanadoo.fr ---
It is deployed in all Wikimedia wikis, and notably multilingual wikis like
commons, Meta, and MediaWiki.wiki itself that have lots of use of #language to
create language navigation bars

The Language bars also performs detection of translations in various ways to
pages, that are either translated with Translate extension or manuall created
with expected differences between languages (e.g. for pages containing user
groups per language, or different contact addresses, or specific items or
issues in specific languages). Or because they need to support some extra
languages not supported by the Translate extension, or because they want to
disable some existing translations that have been blocked from edits and are no
longer maintained (but not deleted and kept as historic).

Detecting existing translations will frequently test the presence of subpages,
and if one is found, it will attempt to reference it in the navigation bar
using a language name returned by #language, but displayed either in the user's
own language, or in the page-content language (both could be different from the
language autonym returned by #language with only 1 parameter.

But the bug is critical when trnalsations are derived from a base page, because
the base page must know that it's the original and not a translation in a
subpage.

As the base page does not have its last subpagename segment matching any
language code, vyr could contain any character authorized in pagenames
(including quotes and ampersands) it is difficult to avoid the case where
#language will be called with the second parameter matching the original
article title.

However it is expected that if code2 does not match any valid language code, it
will be considered as not being a translation but the source language (usually
English on multilingual wikis of Wikimedia, but not necessarily).

So #language should ignore code2 in this case and use only code1, i.e. return
the autonym, or it could use another fallback such as the user's language, or
the page content language if #language can detect it from another source (which
one if this cannot be deduced from the current page name alone, if there's no
language metadata stored for the current page itself?), or the wiki default
language (not always English).

I think that the simplest fix is to discard code2 in this case and return the
autonym (it's not the job of #language to determine another fallback chain,
unless #language accepts more than 2 codes, in a list of parameters target
language codes to look for (if scanning this list is terminated without finding
a valid language, and then none of them provide applicable fallbacks, use code1
as the final target, so return an autonym only).

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 60629] {{#language:code1|code2}} should fail gracefully when Language::isValidCode or stricter is false for code2

2014-01-30 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=60629

--- Comment #5 from Nemo federicol...@tiscali.it ---
Verdy, it's not necessary to repeat everything you've already said.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l