Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.

Commit 6562c9b

Browse files
author
Marian Ruberg
committed
fix: create valid substring from locale
1 parent 6288320 commit 6562c9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/xmlsitemap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,12 @@ private static function getHreflangFromLocale( string $locale ) : string {
597597
// Clean (.whatever@whatever)
598598
$x = strrpos( $locale, '.', 0 );
599599
if ( $x != false ) {
600-
$locale = substr( $locale, 0, -$x );
600+
$locale = substr( $locale, 0, $x );
601601
}
602602
// More clean (just in case @whatever)
603603
$y = strrpos( $locale, '@', 0 );
604604
if ( $y != false ) {
605-
$locale = substr( $locale, 0, -$y );
605+
$locale = substr( $locale, 0, $y );
606606
}
607607
// Huzzah! $locale is now sanitized (which is not the same as canonicalization)
608608
// Ensure hyphens not underscores

0 commit comments

Comments
 (0)