← All changes
|
modules/sitemaps/sitemap-buffer-image-fallback.php
+7
-1
12.0.3
→
16.3-a.1
View file →
| @@ -9,14 +9,20 @@ | ||
| 9 | 9 | * @since 5.3.0 |
| 10 | 10 | * @package automattic/jetpack |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit( 0 ); | |
| 15 | +} | |
| 16 | + | |
| 13 | 17 | /** |
| 14 | 18 | * A buffer for constructing sitemap image xml files for users that have no libxml support. |
| 15 | 19 | * |
| 16 | 20 | * @since 5.3.0 |
| 21 | + * @phan-suppress PhanRedefinedClassReference -- Don't conflict with real version. | |
| 17 | 22 | */ |
| 18 | 23 | class Jetpack_Sitemap_Buffer_Image extends Jetpack_Sitemap_Buffer_Fallback { |
| 24 | + // @phan-suppress-previous-line UnusedSuppression -- It's used. | |
| 19 | 25 | /** |
| 20 | 26 | * Returns a DOM element that contains all image sitemap elements. |
| 21 | 27 | */ |
| 22 | 28 | protected function get_root_element() { |
| @@ -50,9 +56,9 @@ | ||
| 50 | 56 | . '<urlset ' . $this->array_to_xml_attr_string( $namespaces ) . '>' . PHP_EOL, |
| 51 | 57 | '</urlset>', |
| 52 | 58 | ); |
| 53 | 59 | |
| 54 | - $this->byte_capacity -= strlen( join( '', $this->root ) ); | |
| 60 | + $this->byte_capacity -= strlen( implode( '', $this->root ) ); | |
| 55 | 61 | } |
| 56 | 62 | |
| 57 | 63 | return $this->root; |
| 58 | 64 | } |