diff options
author | Derek Allard <derek.allard@ellislab.com> | 2008-03-23 17:24:37 +0100 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2008-03-23 17:24:37 +0100 |
commit | be97bdc41601ead493287d67ac80cd5241ddc746 (patch) | |
tree | 3fc984fca42176d590cd140085e5dd84cf6e77d2 | |
parent | 9b808efd5acd2acd17079a54e5282885c1549a84 (diff) |
Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).
-rw-r--r-- | system/plugins/captcha_pi.php | 10 | ||||
-rw-r--r-- | user_guide/changelog.html | 13 |
2 files changed, 18 insertions, 5 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
diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e48db0e24..230627abe 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,11 +74,16 @@ Change Log </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>
|