2010-08-18 116 views
0

我正在使用一个伟大的Wordpress在亚马逊S3上存储名为“Amazon S3 for WordPress”的文件,它似乎与Wordpress版本3.0+有一个错误。亚马逊S3 for WordPress的错误

我正的错误是:

警告:strpos()预计参数1 是字符串,阵列中 /home/dir/public_html/www.site.com/wp-admin给出上线310

这里/includes/media.php 是代码在周围忽略原始线310:

 
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'); 

我很想知道发生了什么。

谢谢

+0

上述行周围的代码块是什么样的? – 2010-08-18 16:58:16

+0

<?php wp_enqueue_style('global'); wp_enqueue_style('wp-admin'); wp_enqueue_style('colors'); //检查'media'的回调名称 if((is_array($ content_func)&&!empty($ content_func [1])&& 0 === strpos((string)$ content_func [1],'media')) || 0 === strpos($ content_func,'media')) 310行是if语句。 \t wp_enqueue_style('media'); wp_enqueue_style('ie'); ?> – 2010-08-18 17:27:32

回答

1

其实,我认为你已经发现了一个WordPress的错误。那的投掷的错误代码行是这样的:

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

如果你看的是,第二个方案假定$content_func是一个字符串,并通过strpos

通过它也许像

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'))) 

会更好。