简体   繁体   English

WordPress的Amazon S3错误

[英]Error with Amazon S3 for WordPress

I am using a great Wordpress to store files on Amazon S3 called "Amazon S3 for WordPress" it seems to have a bug with version 3.0+ of Wordpress. 我使用了很棒的Wordpress在Amazon S3上存储了名为“ Amazon S3 for WordPress”的文件,似乎在Wordpress 3.0+版本中有一个错误。

The error I am getting is: 我得到的错误是:

Warning: strpos() expects parameter 1 to be string, array given in /home/dir/public_html/www.site.com/wp-admin/includes/media.php on line 310 警告:strpos()期望参数1为字符串,在第310行的/home/dir/public_html/www.site.com/wp-admin/includes/media.php中给出的数组

Here is the code in media.php around line 310: 这是第310行周围的media.php中的代码:

wp_enqueue_style( 'global' );
wp_enqueue_style( 'wp-admin' );
wp_enqueue_style( 'colors' );
// Check callback name for 'media'
if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) || 0 === strpos( $content_func, 'media' ) )
    wp_enqueue_style( 'media' );
wp_enqueue_style( 'ie' );

I would love some clue as to what is going on. 我希望知道发生了什么。

Thanks 谢谢

Actually, I think you've found a bug in WordPress. 实际上,我认为您已经在WordPress中发现了一个错误。 The line of code that's throwing the error is this: 引发错误的代码行是这样的:

if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) || 0 === strpos( $content_func, 'media' ) )

If you look at that, the second scenario assumes $content_func is a string and passes it through strpos 如果您看一下,第二种情况假设$content_func是一个字符串,并将其传递给strpos

Maybe something like 也许像

if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) || ( is_string( $content_func ) && 0 === strpos( (string)$content_func, 'media' ) ) )

Would work better. 会更好地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM