2016-12-27 21 views
0

我使用谷歌驅動WP媒體WordPress插件爲我的WordPress網站 但這個插件保留給我的nginx服務器上的這個錯誤,可有人能幫助我解決這個代碼未定義抵消:1個PHP谷歌驅動WP媒體WordPress插件

 
[error] 4437#4437: *175114 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined offset: 1 in /var/www/myhost/htdocs/wp-content/uploads/gdwpm_images/index.php on line 4 
PHP message: PHP Notice: Undefined offset: 1 in /var/www/myhost/htdocs/wp-content/uploads/gdwpm_images/index.php on line 4 
PHP message: PHP Notice: Undefined offset: 1 in /var/www/myhost/htdocs/wp-content/uploads/gdwpm_images/index.php on line 4" while reading response header from upstream, client: 122.167.98.6, server: myhost, request: "GET /wp-content/uploads/gdwpm_images/0B73eY08zeFxawYUhGOTA.jpg HTTP/1.1", upstream: "fastcgi://127.0.0.1:9070", host: "myhost", referrer: "http://... 

和這裏的gdwpm_image/index.php的代碼

<?php 
if (isset($_GET['imgid'])){ 
    $gdwpm_ekst_gbr = explode('.', $_GET['imgid']); 
    if($gdwpm_ekst_gbr[1] == 'png' || $gdwpm_ekst_gbr[1] == 'gif' || $gdwpm_ekst_gbr[1] == 'bmp'){ 
     header("Content-Type: image/" . $gdwpm_ekst_gbr[1]); 
    }else{ 
     header("Content-Type: image/jpg"); 
    } 
    $gdurl = "https://docs.google.com/uc?id=" . $gdwpm_ekst_gbr[0] . "&export=view"; 
    @readfile($gdurl); 
} 
?> 

我試圖修復代碼,但沒有改變。 有人可以幫助解決它嗎? 謝謝!

回答

0

以下行後...

$gdwpm_ekst_gbr = explode('.', $_GET['imgid']); 

檢查$gdwpm_ekst_gbr有試圖訪問[1]元素之前任何數組項。

如果陣列項目,您試圖訪問的指數,不存在發生您發佈的錯誤信息。