Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).
diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php
index 693fd91..7aa31ef 100644
--- a/system/plugins/captcha_pi.php
+++ b/system/plugins/captcha_pi.php
@@ -244,7 +244,15 @@
// 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
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index e48db0e..230627a 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -74,11 +74,16 @@
</ul>
</li>
<li>Helpers
- <ul>
- <li>Modified <kbd>img()</kbd> in the <a href="helpers/html_helper.html">HTML Helper</a> to remove an unneeded space (#4208).</li>
- <li>Modified <kbd>anchor()</kbd> in the <a href="helpers/url_helper.html">URL helper</a> to convert entities in the title attribute (#4209).</li>
- </ul>
+ <ul>
+ <li>Modified <kbd>img()</kbd> in the <a href="helpers/html_helper.html">HTML Helper</a> to remove an unneeded space (#4208).</li>
+ <li>Modified <kbd>anchor()</kbd> in the <a href="helpers/url_helper.html">URL helper</a> to convert entities in the title attribute (#4209).</li>
+ </ul>
</li>
+ <li>Plugins
+ <ul>
+ <li>Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).</li>
+ </ul>
+ </li>
</ul>
<h3>Bugfixes for 1.6.2</h3>