aboutsummaryrefslogtreecommitdiffstats
path: root/includes/specials/formfields
Commit message (Collapse)AuthorAgeFilesLines
* Use short array destructuring instead of list()Tim Starling2022-10-211-1/+1
| | | | | | | | Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
* Trivial replacements of "-" comparisons with isDisabled()Thiemo Kreuz2022-03-031-1/+1
| | | | | | | | | | | | | | This is split from I1d267ae, as well as a follow-up to Ie70d849. Custom code like this exists because some messages do something like {{#if: … | … | - }} to get dynamically disabled. This is not something isDisabled() supports. That acts on the unparsed message before any {{…}} was expaned. The few cases in this patch are not affected because they use plain(), which does not do any {{…}} expansion anyway. Change-Id: I70541cf28c6fff14422e202f774b86086c2a850c
* Simplify else-branches after continue/breakUmherirrender2021-08-171-14/+13
| | | | | | | When the if branch continues the loop, than the next branch does not need to be an else branch Change-Id: Ia158709b7fd2ea811f1049cf8f53ed12c89719e3
* Use @internal instead of @private per policydaniel2020-06-261-1/+1
| | | | | | | | https://www.mediawiki.org/wiki/Stable_interface_policy mandates the use of @internal. The semantics of @private was never properly defined. Bug: T247862 Change-Id: I4c7c6e7b5a80e86456965521f88d1dfa7d698f84
* Fix the rest of includes/specials/ Squiz.Scope.MethodScope.MissingReedy2020-05-182-3/+3
| | | | Change-Id: Ica6397199603f2979b8c863a1f250da2edd77ba5
* Clean up spacing of doc commentsUmherirrender2019-08-051-2/+2
| | | | | | Align the doc stars and normalize start and end tokens Change-Id: Ib0d92e128e7b882bb5b838bd00c74fc16ef14303
* Replace lowercase {@inheritdoc} with @inheritDocThiemo Kreuz2019-03-011-1/+1
| | | | | | | | | According to the coding standards we even enforce with a custom PHPCS sniff. It currently does not pick these mistakes up because of the curly brackets. I'm not sure if this is worth an update of the PHPCS sniff. I wanted to suggest this fix anyway. Change-Id: I9041ea7a00baf7f55e0ff0e56879a89fb74bb479
* Use PHP 7 '??' operator instead of if-then-elseFomafix2018-10-211-5/+2
| | | | Change-Id: If9d4be5d88c8927f63cbb84dfc8181baf62ea3eb
* Mass conversion of $wgContLang to serviceAryeh Gregor2018-08-111-3/+4
| | | | | | | Brought to you by vim macros. Bug: T200246 Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
* Use PHP 7 "\u{NNNN}" Unicode codepoint escapes in string literalsBartosz Dziewoński2018-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In cases where we're operating on text data (and not binary data), use e.g. "\u{00A0}" to refer directly to the Unicode character 'NO-BREAK SPACE' instead of "\xc2\xa0" to specify the bytes C2h A0h (which correspond to the UTF-8 encoding of that character). This makes it easier to look up those mysterious sequences, as not all are as recognizable as the no-break space. This is not enforced by PHP, but I think we should write those in uppercase and zero-padded to at least four characters, like the Unicode standard does. Note that not all "\xNN" escapes can be automatically replaced: * We can't use Unicode escapes for binary data that is not UTF-8 (e.g. in code converting from legacy encodings or testing the handling of invalid UTF-8 byte sequences). * '\xNN' escapes in regular expressions in single-quoted strings are actually handled by PCRE and have to be dealt with carefully (those regexps should probably be changed to use the /u modifier). * "\xNN" referring to ASCII characters ("\x7F" and lower) should probably be left as-is. The replacements in this commit were done semi-manually by piping the existing "\xNN" escapes through the following terrible Ruby script I devised: chars = eval('"' + ARGV[0] + '"').force_encoding('utf-8') puts chars.split('').map{|char| '\\u{' + char.ord.to_s(16).upcase.rjust(4, '0') + '}' }.join('') Change-Id: Idc3dee3a7fb5ebfaef395754d8859b18f1f8769a
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz Dziewoński2018-05-301-3/+1
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* Fall back to default language when no i18n'ed licenses availableMatthias Mullie2018-05-021-3/+19
| | | | | Bug: T188822 Change-Id: I5de0167b343c2ce3752f54d2b4418a27aad819c0
* Merge "Allow extension of the Special:Upload form"jenkins-bot2018-01-171-21/+59
|\
| * Allow extension of the Special:Upload formMatthias Mullie2018-01-081-21/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Some of the license selection code (License & Licenses) has seen some minor refactor to make it more open to reuse/extension elsewhere. Extension:3D will make use of these for patent selection in Iafb1e7e5da4b67f4c5ae7dda511d130ae10f748c * License/TemplateSelectorLine has been modified so the text can be wikitext (as needed for patent labels) * uploadLicense was renamed to uploadTemplatePreview and altered so it can be reused elsewhere. And, like window.wgUploadWarningObj, uploadTemplatePreview is now also added to `window` so it can be re-used from elsewhere (to preview patent templates) Bug: T182683 Change-Id: I0c097442aa557dd90eb5825553ebf892f9af8a01
* | Remove various redundant '@license' tags in file headersTimo Tijhof2018-01-121-1/+0
|/ | | | | | | | | | | | | Redundant given this is the project-wide license already, especially in file headers that already include the GPL license header. This and other minor fixups based on feedback from Ie0cea0ef5027c7e5. * Add @file where missing. * Move @ingroup and @deprecated from file to class doc where needed. Change-Id: I7067abb7abee1f0c238cb2536e16192e946d8daa
* Split off remaining helper classes for special pages to separate filesBartosz Dziewoński2017-09-123-0/+294
includes/specials/formfields/ * EditWatchlistCheckboxSeriesField (for SpecialEditWatchlist) * UploadSourceField (for SpecialUpload) * Licenses (for SpecialUpload) includes/specials/forms/ * EditWatchlistNormalHTMLForm (for SpecialEditWatchlist) * PreferencesForm (for SpecialPreferences) * UploadForm (for SpecialUpload) includes/specials/helpers/ * ImportReporter (for SpecialImport) * License (for SpecialUpload) Change-Id: I58abcbb44dbf9bf1762b4252555f7552bfa7c253