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

Commit 3a3bf30

Browse files
author
Marian Ruberg
committed
fix: create valid substring from locale
1 parent 38eece6 commit 3a3bf30

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
@@ -607,12 +607,12 @@ private static function getHreflangFromLocale( string $locale ) : string {
607607
// Clean (.whatever@whatever)
608608
$x = strrpos( $locale, '.', 0 );
609609
if ( $x != false ) {
610-
$locale = substr( $locale, 0, -$x );
610+
$locale = substr( $locale, 0, $x );
611611
}
612612
// More clean (just in case @whatever)
613613
$y = strrpos( $locale, '@', 0 );
614614
if ( $y != false ) {
615-
$locale = substr( $locale, 0, -$y );
615+
$locale = substr( $locale, 0, $y );
616616
}
617617
// Huzzah! $locale is now sanitized (which is not the same as canonicalization)
618618
// Ensure hyphens not underscores

0 commit comments

Comments
 (0)