2016-12-27 2 views
0

Ich benutze google drive WP media WordPress plugin für meine WordPress-Site aber dieses Plugin geben Sie diesen Fehler auf meinem Nginx-Server, kann mir jemand helfen, diesen CodeUndefined Offset: 1 php google drive wp media WordPress plugin

zu beheben
 
[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://... 

und hier ist der gdwpm_image/index.php Code

<?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); 
} 
?> 

ich habe versucht, den Code, aber keine Änderungen zu beheben. Jemand kann helfen, es zu beheben? Danke!

Antwort

0

Nach der folgenden Zeile ...

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

Überprüfen Sie, ob $gdwpm_ekst_gbr alle Array-Elemente hat, bevor Sie das [1] Element zuzugreifen versuchen.

Die von Ihnen angegebene Fehlermeldung tritt auf, wenn das Array-Element im Index, auf den Sie zugreifen möchten, nicht vorhanden ist.