Skip to content

Commit 9dd3a1b

Browse files
committed
Fix for blog post url sufix
1 parent d0f7933 commit 9dd3a1b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Model/Url.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,17 @@ public function getMediaUrl($file)
200200
*/
201201
public function trimSufix($identifier)
202202
{
203-
return trim(
204-
$identifier,
205-
$this->getPostUrlSufix()
206-
);
203+
$sufix = $this->getPostUrlSufix();
204+
if ($sufix) {
205+
$p = mb_strrpos($identifier, $sufix);
206+
$li = mb_strlen($identifier);
207+
$ls = mb_strlen($sufix);
208+
if ($p + $ls == $li) {
209+
$identifier = mb_substr($identifier, 0, $p);
210+
}
211+
}
212+
213+
return $identifier;
207214
}
208215

209216
/**

0 commit comments

Comments
 (0)