This fixes change 3bf7584c51 where after that, "nsN" is label for checkbox instead of human-readable name, as previous behaviour.
Bug: T362458
Change-Id: Iefa31ebf3759a9bf53d66c3b3c6f5e7dd76f4178
The class property is declared and defined to be string,
the extra null check from isset() is not needed here.
Change-Id: Ia2815a2a5df897efde3ace3fac87a85c69ac46ba
This requires 1.42 for the new type
Bug: T354216
Follow-Up: Ib70e4e67e4cb1b65ac218c095864fb6eb43d0929
Change-Id: Id3f5f31bcc6183e8a72b05bfe344a72285c7a8b2
- Use IContextSource::getActionName directly and not
MediaWiki::getAction
- Use IContextSource::getConfig instead of MainConfig
- Use getRawVal to check against constant value
- Use local var to avoid repeatly calls
Change-Id: I592e4451035c37c35fe181fa69b080f3f7a31ec8
Add a @phan-suppress-next-line PhanSuspiciousValueComparison because of
a false positive finding:
includes/InputBox.php:471 PhanSuspiciousValueComparison
Suspicious attempt to compare $this->mType of type 'comment'
to 'comment' of type 'comment' with operator '==='
Change-Id: Id14028d22c1d352a0886a7da0d94b0329a5418df
This is meant to tell the user "please don't do this", "this
combination of parameters is dangerous". But there are other ways
to make links with these parameters. Another patch that changes the
relevant code in EditPage that is responsible for this issue will
follow.
Bug: T297725
Change-Id: I75946e2fc73266802333a77086b7ff6a74f2f3e6
This matches modern practice a little better: the InputBoxHooks class
can (eventually) contain the service objects needed by this extension
and make them available to the hooks. It also avoids the need to
explicitly name this class and its namespace.
Followup-To: Iaaff18b50619f490a4437be7f4d95845c8e0eedb
Change-Id: I07a574eca2d0012e3f7e6172d75cffd34392b1b4
This is a pre-patch for I5144fd6c54 to add a namespace for InputBox and
making sure that this still works, independently of what we're doing
later.
Change-Id: Iaaff18b50619f490a4437be7f4d95845c8e0eedb
Remove the JavaScript module and its logic to toggle the disabled
state on the submit button. Instead, let the browser handle this
natively by setting the `required` attribute, which naturally prevents
early submissions.
Retain the current styling for 99% of cases by using the
:required:invalid selector to target the submit button to make it
appear disabled. This slight duplication of styles is needed because,
despite the form effectively being disabled natively, the core
mediawiki-ui styles only account for :disabled on the button directly
and not e.g. inherited via form:invalid. It is also unclear whether
we would want that, since there is some value to be had from having
the form give a consistent look with a progressive button that can
be submitted even at the wrong time to yield an assistive message to
the required field, so hence handling this locally for now instead of
with a generalised approach.
In order to use the required true/false idiom, I have switched the
generating of the HTML string from the old Xml::element method
to Html::element. This means there is no need to store it in an array
first and conditionally set it since true/false will result in absence
or required="" as needed.
As side-effect from this, redundant attributes like value="" and
type="text" are ommitted from the output, just as MediaWiki core does
more generally.
Bug: T283303
Change-Id: I2c75e09dd3f89fa11fca311b4e1f8133946b01b1
$params['title'] can be an array if someone has messed with the query
parameters.
Use WebRequest::getText(), which guarantees strings (and which is
already used for 'prefix' earlier in this method).
Change-Id: I7b974067fdee22fc42c07fad98af4619fa850269
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Commenting.PropertyDocumentation.WrongStyle
Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).
* Added the `wikimedia/mediawiki` profile in .eslintrc.json (T262222).
Change-Id: Ic7e903cc97b3766fcff467b382caf2a5a6bc5089
Provide an option to supply the aria-label attribute to the inputbox to
allow generated markup be accessible to screen readers
<inputbox>
type=search
width=120
buttonlabel=Search
arialabel=Search this wiki
</inputbox>
Bug: T242354
Change-Id: I40c62bc9889a4912b43244ec65e628ec8bc8533f
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0)
instead of the HTML/XML entitiy  .
Bug: T154300
Change-Id: Ica1a16c7114ec2c5bea04b21f14cf083eb4e417b
phan-taint-check gets confused when you escape a variable and
assign the escaped version to the same name as the unescaped
version.
Change-Id: I1bf4d64e68bff516b5f8b6266d85f67020008433