export: Cast File::getSize to string on dump

Xml::element needs a string to produce the tag,
explicit cast the integer and convert the possible false to zero.

Found by phan strict checks

Change-Id: I349d9ab2f999a569a90402d5197fba56e5451fc2
This commit is contained in:
Umherirrender 2022-03-02 22:47:29 +01:00 committed by Thiemo Kreuz (WMDE)
parent ccaeb83680
commit 04d4b5addb

View file

@ -717,7 +717,7 @@ class XmlDumpWriter {
" " . Xml::element( 'filename', null, $file->getName() ) . "\n" .
$archiveName .
" " . Xml::element( 'src', null, $file->getCanonicalUrl() ) . "\n" .
" " . Xml::element( 'size', null, $file->getSize() ) . "\n" .
" " . Xml::element( 'size', null, (string)( $file->getSize() ?: 0 ) ) . "\n" .
" " . Xml::element( 'sha1base36', null, $file->getSha1() ) . "\n" .
" " . Xml::element( 'rel', null, $file->getRel() ) . "\n" .
$contents .