diff --git a/core/app/captcha/captcha-grid.php b/core/app/captcha/captcha-grid.php index 0ad71809..0ada47c2 100644 --- a/core/app/captcha/captcha-grid.php +++ b/core/app/captcha/captcha-grid.php @@ -43,7 +43,7 @@ public function render($code) public function __destruct() { // Make sure we clean up the main image when we're done. - if (!empty($this->image)) + if (is_resource($this->image)) @imagedestroy($this->image); } } diff --git a/core/app/captcha/captcha-ledicons.php b/core/app/captcha/captcha-ledicons.php index f01e7591..9e603c90 100644 --- a/core/app/captcha/captcha-ledicons.php +++ b/core/app/captcha/captcha-ledicons.php @@ -215,7 +215,7 @@ protected function load_font() public function __destruct() { // Make sure we clean up the main image when we're done. - if (!empty($this->image)) + if (is_resource($this->image)) @imagedestroy($this->image); // Make sure we clean up any leds we created. Doing it this way means we have freedom later if we expand this to multi-colored or something. diff --git a/core/app/captcha/captcha-ledicons_anim.php b/core/app/captcha/captcha-ledicons_anim.php index 1c3c8614..92a93af0 100644 --- a/core/app/captcha/captcha-ledicons_anim.php +++ b/core/app/captcha/captcha-ledicons_anim.php @@ -137,7 +137,7 @@ protected function create_led($id, $background = false, $lowlight_col = '', $hig protected function paint_led($id, $x, $y, $image = null) { - imagecopy ($image, $this->leds[$id], $x, $y, 0, 0, 4, 4); + imagecopy($image, $this->leds[$id], $x, $y, 0, 0, 4, 4); } protected function assign_colors($image) diff --git a/core/app/captcha/captcha-silhouette.php b/core/app/captcha/captcha-silhouette.php index 627a07de..57a51475 100644 --- a/core/app/captcha/captcha-silhouette.php +++ b/core/app/captcha/captcha-silhouette.php @@ -45,7 +45,7 @@ public function render($code) public function __destruct() { // Make sure we clean up the main image when we're done. - if (!empty($this->image)) + if (is_resource($this->image)) @imagedestroy($this->image); } } diff --git a/core/app/captcha/captcha-stripes.php b/core/app/captcha/captcha-stripes.php index 99969b5f..538945e7 100644 --- a/core/app/captcha/captcha-stripes.php +++ b/core/app/captcha/captcha-stripes.php @@ -76,7 +76,7 @@ public function render($code) public function __destruct() { // Make sure we clean up the main image when we're done. - if (!empty($this->image)) + if (is_resource($this->image)) @imagedestroy($this->image); } }