summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/plugins/captcha_pi.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php
index 693fd9117..7aa31efb1 100644
--- a/system/plugins/captcha_pi.php
+++ b/system/plugins/captcha_pi.php
@@ -244,7 +244,15 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path =
// Create image
// -----------------------------------
- $im = ImageCreate($img_width, $img_height);
+ // PHP.net recommends imagecreatetruecolor(), but it isn't always available
+ if (function_exists(imagecreatetruecolor))
+ {
+ $im = imagecreatetruecolor($img_width, $img_height);
+ }
+ else
+ {
+ $im = imagecreate($img_width, $img_height);
+ }
// -----------------------------------
// Assign colors