Skip to content

Instantly share code, notes, and snippets.

@ts0818
Created November 5, 2015 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ts0818/f014d4af474390f68ee8 to your computer and use it in GitHub Desktop.
Save ts0818/f014d4af474390f68ee8 to your computer and use it in GitHub Desktop.
パーフェクトPHP 画像ファイルに偽装したPHPスクリプト
<?php
$file = dirname(__FILE__).'/fake_image.gif';
$size = @getimagesize($file);
if (
(isset($size[0]) === true && $size[0] > 0)
&& (isset($size[1]) === true && $size[1] > 0)
&& (isset($size[2]) === true && $size[2] === IMAGETYPE_GIF)
) {
// 画像ファイルなら、画像の情報を表示
var_dump($size);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment