+ throw exception is guids not appropriated to local site url
* basename extraction support multibyte strings filenames
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user