mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-23 15:57:10 +00:00
Add support for PHP 8.0 and PHP 8.1 (#93)
This commit is contained in:
parent
aead92451c
commit
e5ca418763
7
.github/workflows/mediawiki-tests.yml
vendored
7
.github/workflows/mediawiki-tests.yml
vendored
|
@ -62,6 +62,13 @@ jobs:
|
|||
experimental: true
|
||||
stage: phpunit
|
||||
|
||||
# Latest MediaWiki master - PHP 8.1 (phpunit)
|
||||
- mw: 'master'
|
||||
php: 8.1
|
||||
php-docker: 81
|
||||
experimental: false
|
||||
stage: phpunit
|
||||
|
||||
# Latest stable MediaWiki - PHP 7.4 (selenium)
|
||||
- mw: 'REL1_39'
|
||||
php: 7.4
|
||||
|
|
|
@ -156,7 +156,7 @@ class PortableInfoboxParserTagController {
|
|||
// (see: PortableInfoboxDataService.class.php)
|
||||
|
||||
$infoboxes = json_decode(
|
||||
self::parserOutputGetPageProperty( $parserOutput, PortableInfoboxDataService::INFOBOXES_PROPERTY_NAME ),
|
||||
self::parserOutputGetPageProperty( $parserOutput, PortableInfoboxDataService::INFOBOXES_PROPERTY_NAME ) ?? '',
|
||||
true
|
||||
);
|
||||
|
||||
|
|
|
@ -65,13 +65,13 @@ class FileNamespaceSanitizeHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param string|null $filename
|
||||
* @param Language $contLang
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function sanitizeImageFileName( $filename, $contLang ) {
|
||||
$plainText = $this->convertToPlainText( $filename );
|
||||
$plainText = $this->convertToPlainText( $filename ?? '' );
|
||||
$filePrefixRegex = $this->getFilePrefixRegex( $contLang );
|
||||
$textLines = explode( PHP_EOL, $plainText );
|
||||
|
||||
|
@ -87,7 +87,7 @@ class FileNamespaceSanitizeHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $filename
|
||||
* @param string $filename
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -48,7 +48,7 @@ class MediaWikiParserService implements ExternalParser {
|
|||
return $this->cache[$wikitext];
|
||||
}
|
||||
|
||||
$parsed = $this->parser->recursiveTagParse( $wikitext, $this->frame );
|
||||
$parsed = $this->parser->recursiveTagParse( $wikitext ?? '', $this->frame );
|
||||
if ( in_array( substr( $parsed, 0, 1 ), [ '*', '#' ] ) ) {
|
||||
// fix for first item list elements
|
||||
$parsed = "\n" . $parsed;
|
||||
|
|
|
@ -28,7 +28,7 @@ class NodeMedia extends Node {
|
|||
|
||||
public static function getMarkers( $value, $ext ) {
|
||||
$regex = '/' . Parser::MARKER_PREFIX . "-$ext-[A-F0-9]{8}" . Parser::MARKER_SUFFIX . '/i';
|
||||
if ( preg_match_all( $regex, $value, $out ) ) {
|
||||
if ( preg_match_all( $regex, $value ?? '', $out ) ) {
|
||||
return $out[0];
|
||||
} else {
|
||||
return [];
|
||||
|
|
Loading…
Reference in a new issue