aboutsummaryrefslogtreecommitdiffstats
path: root/includes/media/SVGReader.php
Commit message (Collapse)AuthorAgeFilesLines
* Move isWellFormedLanguageTag from Language to LanguageCodeFomafix2022-08-301-2/+2
| | | | | | | | | | | | The static function isWellFormedLanguageTag is related to BCP 47 language codes not to the internal language codes or language names. The new function LanguageCode::isWellFormedLanguageTag uses type hints. THe explicit type cast (bool) is not necessary anymore. The old function Language::isWellFormedLanguageTag is now deprecated. Change-Id: I6431dbd82ed6dfcc2a7c3495eca025506551db05
* Use MainConfigNames instead of string literals, #4Aryeh Gregor2022-04-261-1/+3
| | | | | | | | | | | | | | | | | | | | | Now largely automated: VARS=$(grep -o "'[A-Za-z0-9_]*'" includes/MainConfigNames.php | \ tr "\n" '|' | sed "s/|$/\n/;s/'//g") sed -i -E "s/'($VARS)'/MainConfigNames::\1/g" \ $(grep -ERIl "'($VARS)'" includes/) Then git add -p with lots of error-prone manual checking. Then semi-manually add all the necessary "use" lines: vim $(grep -L 'use MediaWiki\\MainConfigNames;' \ $(git diff --cached --name-only --diff-filter=M HEAD^)) I didn't bother fixing lines that were over 100 characters unless they were over 120 and triggered phpcs. Bug: T305805 Change-Id: I74e0ab511abecb276717ad4276a124760a268147
* Add various fallback values for null return valuesUmherirrender2022-03-091-3/+3
| | | | | | Found by phan strict checks Change-Id: I83187b5fd25b015d2c75e22d4b5202803653d743
* Replace some more usages of Wikimedia\(suppress|restore)Warnings()Reedy2022-02-241-2/+3
| | | | Change-Id: I2eb133a9e32116cd155f59086245bc4d15ecbfcc
* Suppress deprecation warnings from libxml_disable_entity_loader()Tim Starling2022-01-211-2/+3
| | | | | | | | | | As discussed in the task, there is no simple replacement for this function. Reduces core PHPUnit error count from 121 to 2. Bug: T268847 Change-Id: Ia8697e1c3ba369346b39ef50d94ea8b132eb9c80
* Refactor global variables to use MediaWikiServices insteadTChin2022-01-101-4/+7
| | | | | | | | | | | | Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI. Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228 * This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it. A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
* Remove unused default values from class propertiesThiemo Kreuz2021-05-121-2/+2
| | | | | | | | In all these cases the property is unconditionally set in the constructor. The extra initialisation is effectively dead code and an extra source of errors and confusion. Change-Id: Icae13390d5ca5c14e2754f3be4eb956dd7f54ac4
* SVGReader.php: Reduce code duplication by using finally {}Reedy2021-02-071-3/+2
| | | | Change-Id: I916171216dc96b46120d11b492f14b8d791c1b3c
* Revert "Wrap libxml_disable_entity_loader() calls in version constraint"Reedy2021-01-271-18/+11
| | | | | | | | | This reverts commit a4c69bde130c6109086d555492adc1378b1ca29b. Reason for revert: Needs a bit more thinking about Bug: T268847 Change-Id: I82a7bb2a4ef15adc65717d5ba173c8f3cfb0644c
* Wrap libxml_disable_entity_loader() calls in version constraintReedy2021-01-271-11/+18
| | | | | Bug: T268847 Change-Id: I56684ce7b39aaebe1ae76811b833bc9183bc359b
* Remove terminating line breaks from debug messagesTim Starling2020-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | A terminating line break has not been required in wfDebug() since 2014, however no migration was done. Some of these line breaks found their way into LoggerInterface::debug() calls, where they mess up the formatting of the debug log. So, remove terminating line breaks from wfDebug() and LoggerInterface::debug() calls. Also: * Fix the stripping of leading line breaks from the log header emitted by Setup.php. This feature, accidentally broken in 2014, allows requests to be distinguished in the log file. * Avoid using the global variable $self. * Move the logging of the client IP back to Setup.php. It was moved to WebRequest in the hopes that it would not always be needed, however $wgRequest->getIP() is now called unconditionally a few lines up in Setup.php. This means that it is put in its proper place after the "start request" message. * Wrap the log header code in a closure so that variables like $name do not leak into global scope. * In Linker.php, remove a few instances of an unnecessary second parameter to wfDebug(). Change-Id: I96651d3044a95b9d210b51cb8368edc76bebbb9e
* Fix includes/media/ Squiz.Scope.MethodScope.MissingReedy2020-05-181-2/+2
| | | | Change-Id: I2bf5543b99dc2ae05f7de02940d120dee353adfe
* Add const visibility to includes/mediaMax Semenik2020-04-261-5/+5
| | | | Change-Id: I80ec7aa44b1ea5e7b7d6193732b7da03d7f11960
* Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNullJames D. Forrester2020-01-101-1/+1
| | | | Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
* Improve param docsUmherirrender2019-11-281-2/+2
| | | | Change-Id: I746a69f6ed01c3ff000da125457df62b02d13b34
* Split SVGReader to its own fileReedy2019-04-141-0/+384
Change-Id: I9fc442225a37c14d0606508aed5ef496a5ad82ba