+ throw exception is guids not appropriated to local site url

* basename extraction support multibyte strings filenames
This commit is contained in:
2022-07-10 19:51:25 +03:00
parent 84abee4234
commit 0e490e3fc6
6 changed files with 37 additions and 8 deletions

View File

@ -1,7 +1,5 @@
<?php namespace WpsMcloud\Models;
use JetBrains\PhpStorm\Pure;
class PostAttachment
{
const META_KEY_FLAGGED_AS_404 = '_wp_media_cloud_transform_404';
@ -47,7 +45,7 @@ class PostAttachment
public function getBasename(): string
{
return basename($this->getUrl());
return mb_basename($this->getUrl());
}
public function getPostMimeType(): string
@ -57,7 +55,6 @@ class PostAttachment
public function setAttachmentMetaData(array $meta)
{
update_post_meta($this->getId(), self::META_KEY_ATTACHMENT_METADATA, $meta);
}