コード例 #1
0
ファイル: plugin.php プロジェクト: nsine/webmail-lite
 /**
  * @param string $sImageName
  * @return string
  */
 public function GetImage($sImageName)
 {
     $sImageName = $this->oPluginManager->GetImage($this->sName, $sImageName);
     if ($sImageName) {
         $sContentType = \MailSo\Base\Utils::MimeContentType($sImageName);
         if ('image' === \MailSo\Base\Utils::ContentTypeType($sContentType, $sImageName)) {
             @header('Content-Type: ' . $sContentType);
             //				$sFilePath = $this->GetPath() . '/images/' . $sImageName;
             $sFilePath = $sImageName;
             if (file_exists($sFilePath)) {
                 return file_get_contents($sFilePath);
             } else {
                 if (function_exists('http_response_code')) {
                     \http_response_code(404);
                 } else {
                     \header("HTTP/1.1 404 Not Found", true, 404);
                 }
             }
         }
     }
 }