2010-08-18 118 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'))) 

會更好。