updated plugin ActivityPub version 9.1.0
This commit is contained in:
@ -568,7 +568,7 @@ abstract class File {
|
||||
// Method 4: Ensure file extension matches MIME type.
|
||||
$ext = \pathinfo( $file_path, PATHINFO_EXTENSION );
|
||||
|
||||
if ( strtolower( $ext ) !== $expected_ext ) {
|
||||
if ( \strtolower( $ext ) !== $expected_ext ) {
|
||||
$new_path = \preg_replace( '/\.[^.]+$/', '.' . $expected_ext, $file_path );
|
||||
if ( empty( $new_path ) || $new_path === $file_path ) {
|
||||
$new_path = $file_path . '.' . $expected_ext;
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
namespace Activitypub\Cache;
|
||||
|
||||
use Activitypub\Collection\Actors;
|
||||
use Activitypub\Model\Application;
|
||||
use Activitypub\Model\Blog;
|
||||
use Activitypub\Statistics;
|
||||
|
||||
@ -208,16 +207,16 @@ class Stats_Image extends File {
|
||||
|
||||
$actor = Actors::get_by_id( $user_id );
|
||||
|
||||
if ( \is_wp_error( $actor ) ) {
|
||||
if ( Actors::BLOG_USER_ID === $user_id ) {
|
||||
$actor = new Blog();
|
||||
} elseif ( Actors::APPLICATION_USER_ID === $user_id ) {
|
||||
$actor = new Application();
|
||||
}
|
||||
if ( \is_wp_error( $actor ) && Actors::BLOG_USER_ID === $user_id ) {
|
||||
$actor = new Blog();
|
||||
}
|
||||
|
||||
$actor_webfinger = ! \is_wp_error( $actor ) ? $actor->get_webfinger() : '';
|
||||
$site_name = \get_bloginfo( 'name' );
|
||||
if ( ! \is_wp_error( $actor ) ) {
|
||||
$actor_webfinger = $actor->get_webfinger();
|
||||
} else {
|
||||
$actor_webfinger = '';
|
||||
}
|
||||
$site_name = \get_bloginfo( 'name' );
|
||||
|
||||
if ( ! \function_exists( 'wp_tempnam' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/file.php';
|
||||
|
||||
Reference in New Issue
Block a user