Commit graph

16 commits

Author SHA1 Message Date
Brian Wolff
f05bf40540 Deprecate QuickTemplate::msgHtml & fix phan-taint-warning in includes/skins
QuickTemplate::msgHtml() (And the weird override that does the
same thing a different way - BaseTemplate::msgHtml()) are inherently
unsafe as they echo out a raw html message. This is strongly
discouraged in modern code. According to codeSearch tool, nothing
uses these methods, and there is a "@private" annotation on the
QuickTemplate::msgHtml() docblock. Thus hard deprecating it.

Change-Id: I4e9e157e922a36787adef4d0bf7608605c27f0c4
2018-09-21 17:27:43 -07:00
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
Fomafix
0f1858321c Use PHP 7 '??' operator instead of if-then-else
Change-Id: I790b86e2e9e3e41386144637659516a4bfca1cfe
2018-06-12 23:14:18 +02:00
Timo Tijhof
e912be7387 skins: Remove MediaWikiI18N class and QuickTemplate::setTranslator
Deprecated in 1.31.

Bug: T186090
Change-Id: I2ff268868bf6f112add6fc3a5718e83467781b13
2018-04-18 00:49:24 +01:00
Umherirrender
63d96c15fd build: Updating mediawiki/mediawiki-codesniffer to 16.0.0
Change-Id: I59b59f79bbf3ce4feff3b3a20c1c31bc16370531
2018-02-17 13:29:13 +01:00
Timo Tijhof
7f281e2db4 skins: Deprecate MediaWikiI18N::translate()
Remove all usage of $tpl->translator->translate() with wfMessage()->text(),
which does the same thing, given the deprecated $tpl->translator->set()
and $tpl->setTranslator() methods have no callers.

These new wfMessage() callers should probably be changed to context calls
via BaseTemplate::msg() or Skin::msg() at some point, but I'm reserving that
for a separate commit given wfMessage() is what MediaWikiI18N::translate()
currently does - to reduce risk of unrelated behaviour changes.

While `$tpl->setTranslator` and `MediaWikiI18N::set` ($tpl->translator->set)
have no known callers in Wikimedia Git, the `$tpl->translator->translate`
method does have a handful of calls (although less than three, and not in
bundled or WMF-deployed repos). As such, proceeding with hard-deprecation.

Bug: T186090
Change-Id: I93d503de5515298288852ec4c150959fd688786b
2018-02-02 23:53:19 +00:00
Timo Tijhof
d4aaeb0a99 skins: Deprecate QuickTemplate::setTranslator and MediaWikiI18N::set
These methods have no callers anywhere in Wikimedia Git.
Deprecate it now, remove in MediaWiki 1.32.

This is part of removing the legacy MediaWikiI18N class.

Bug: T186090
Change-Id: Ie2ca6a4b4f4481dc5cd81e7ed5543a05ee611f42
2018-02-02 12:45:33 -08:00
Timo Tijhof
dc1e092e69 skins: Deprecate QuickTemplate::setRef()
Removed all use from core. It was only used in a handful of other
repos, most of which have been updated already.

Bug: T140664
Change-Id: I6b1ea3221022597ca38a5cd40eee040d34d1abb8
2018-01-31 21:13:18 +00:00
Umherirrender
9b8b314992 Fix spacing for @param and indent of function comments
In phpcs.xml rename renamed sniffs and add the failing sniffs,
because now the whole sniff is no longer excluded.

Change-Id: If5b0bd16028761abc2c47ace9e97d37ad14bb36f
2017-08-15 14:33:29 +00:00
Umherirrender
a9007e8baf Add missing & to @param documentation to match functon call
Change-Id: I81e68310abcbc59964b22e0e74842d509f6b1fb9
2017-08-11 18:47:46 +02:00
addshore
8c5d276eef Add missing class propertys in QuickTemplate
Change-Id: I327ac1207af8fcf9db792b3835b8a35378330eb6
2017-06-30 10:01:19 +01:00
addshore
b12086b618 Get ConfigFactory & MainConfig from MediaWikiServices
Change-Id: Iafdd7e00747060572463ffb05aae4543f3a06163
2016-11-23 00:12:38 +00:00
Gergő Tisza
50c3fdc2db Fix FakeTemplate usage in LoginSignupSpecialPage
Despite the @return doctag, QuickTemplate::html does not return
template fields but prints them on stdout.

Also fix the doctags.

Bug: T137723
Change-Id: Ifb53ab5bdf3a4fac1e642fa6be1d88df6cef7bc7
2016-06-15 17:55:19 +02:00
Bartosz Dziewoński
667522795b Fix trivial PHPCS violations in */skins/* directories
Due to T127238, files in various */skins/* directories are not checked
by PHPCS. Temporarily removed the exclude rule from phpcs.xml and ran:

  composer fix includes/skins/* tests/phpunit/includes/skins/* tests/phpunit/skins/*

Change-Id: I9240c1cee825920b6634903282be6252cce55686
2016-03-02 21:02:15 +01:00
Sumit Asthana
b9b75d2031 Templates:Captcha position modified,extend functionality added to QuickTemplate
The ConfirmEdit extension presently inserts captcha in the header of Usercreate
and Userlogin templates. The js,if enabled places the captcha before submit
button.  A separate 'extrafields' placeholder for captcha is added just before
submit button in Usercreate.php so that captcha position remains consistent,
even if js is disabled.  An extend method added to QuickTemplate to append any
data to existing field, rather than setting it with fresh data. Particular use
for 'extrafields' in Usercreate and Userlogin.

Bug: T85192
Change-Id: I82c68814e79cbc5aa250a308862c59fcbb6fd527
2015-01-20 19:24:26 +05:30
Bartosz Dziewoński
a3bf1f610e Split SkinTemplate.php per-class
Change-Id: Id964cdc3bd362d696628d62cd34615aa1fa6b014
2014-09-24 11:54:26 +02:00