File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/PhpSpreadsheet/Reader Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -645,7 +645,7 @@ public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Sp
645
645
// Reload the HTML file into the DOM object
646
646
try {
647
647
$ convert = $ this ->getSecurityScannerOrThrow ()->scanFile ($ filename );
648
- $ convert = $ this -> replaceNonAsciiIfNeeded ($ convert );
648
+ $ convert = self :: replaceNonAsciiIfNeeded ($ convert );
649
649
$ loaded = ($ convert === null ) ? false : $ dom ->loadHTML ($ convert );
650
650
} catch (Throwable $ e ) {
651
651
$ loaded = false ;
@@ -738,7 +738,7 @@ private static function replaceNonAscii(array $matches): string
738
738
return '&# ' . mb_ord ($ matches [0 ], 'UTF-8 ' ) . '; ' ;
739
739
}
740
740
741
- private function replaceNonAsciiIfNeeded (string $ convert ): ?string
741
+ private static function replaceNonAsciiIfNeeded (string $ convert ): ?string
742
742
{
743
743
if (preg_match (self ::STARTS_WITH_BOM , $ convert ) !== 1 && preg_match (self ::DECLARES_CHARSET , $ convert ) !== 1 ) {
744
744
$ lowend = "\u{80}" ;
@@ -763,7 +763,7 @@ public function loadFromString(string $content, ?Spreadsheet $spreadsheet = null
763
763
// Reload the HTML file into the DOM object
764
764
try {
765
765
$ convert = $ this ->getSecurityScannerOrThrow ()->scan ($ content );
766
- $ convert = $ this -> replaceNonAsciiIfNeeded ($ convert );
766
+ $ convert = self :: replaceNonAsciiIfNeeded ($ convert );
767
767
$ loaded = ($ convert === null ) ? false : $ dom ->loadHTML ($ convert );
768
768
} catch (Throwable $ e ) {
769
769
$ loaded = false ;
You can’t perform that action at this time.
0 commit comments