As per https://www.php.net/manual/en/function.libxml-disable-entity-loader.php
this is technically unnecessary.
>However, as of libxml 2.9.0 entity substitution is disabled by default,
>so there is no need to disable the loading of external entities.
See also https://github.com/php/php-src/pull/5867
>Since the release of libxml 2.9.0 in 2012 external entity loading is
>disabled in libxml by default. This means that using
>libxml_disable_entity_loader() is no longer needed.
Hopefully helps prevent false positive reports from security scanning tools.
Change-Id: I8a09d62a9920fd0bf4a388baa5544a02323bb541
Upstream bug reports of the behavior change introduced in PHP 7.3.17 (and
applied to PHP 7.4 branch as well):
https://bugs.php.net/bug.php?id=79528https://bugs.php.net/bug.php?id=79485
The reponsible commit in PHP was https://github.com/php/php-src/pull/5246
This was a "bug fix" in the sense that SimpleXML used to discard the
attributes on the namespace elements, which look like this:
<namespace key="-2" case="first-letter">Media</namespace>
SimpleXML used to return this as a string "Media" instead of a
SimpleXMLElement... but ExportTest (inadvertently?) depended on that
behavior.
In any case, if we iterate over SimpleXMLElement::children() we always
get SimpleXMLElements, not "sometimes strings", and so our code will
correct correctly on PHP below 7.3.17 and above, regardless of how PHP
decides to handle this "bug".
Bug: T250568
Change-Id: I9c2cb6a86fd6e8023c1979ec6838071a87a7bcea
Though getOutput() is what first came to mind, I do not particularly
like the name, partly because it is used in many, many places as a
method that returns an OutputPage object.
* Renamed the method to __toString(). This is appropriate because
each instance, at any given time, corresponds to a single string
value (and exceptions cannot occur during this conversion).
* Removed unnecessary variables from ApiQuery and ExportTest. In
these and most other cases, it should no longer be necessary to
call getOutput() explicitly.
Change-Id: Icf202743d1f332f8981338f42eb6e3e5a04abdf1
Specifically, it is not necessary to use output buffering functions
to capture XML generated by the export code because it is already
possible to set the "output sink" object to be used.
* Created a DumpStringOutput class, which appends all output to a
string property rather than printing output immediately.
* Used that class, instead of ob_start() and ob_get_clean(), in
ApiQuery and ExportTest.
Change-Id: I238f5d5ec7fd442c845b25cb59ef81ac3285099f
Removed redundant set up in these classes (same as their paren
class MediaWikiLangTestCase does already).
* BlockTest
* ExportTest
* MWTimestampTest
* TitlePermissionTest
Change-Id: I28d18cb797bb249981727b02dffce4f0d8682b02
Reserved words, like 'namespace', are perfectly fine now to use as object
keys, but it seems they used to not be in PHP 5.3, necessitating workarounds.
Change-Id: Iecb79fda19803461dfb3800b8af4d31e971551b8