summaryrefslogtreecommitdiff
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Controller.php12
-rw-r--r--system/libraries/drivers/Captcha/Alpha.php4
2 files changed, 12 insertions, 4 deletions
diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php
index d111f25e..2f64c211 100644
--- a/system/libraries/Controller.php
+++ b/system/libraries/Controller.php
@@ -3,7 +3,7 @@
* Kohana Controller class. The controller class must be extended to work
* properly, so this class is defined as abstract.
*
- * $Id: Controller.php 3979 2009-02-13 16:46:12Z zombor $
+ * $Id: Controller.php 4365 2009-05-27 21:09:27Z samsoir $
*
* @package Core
* @author Kohana Team
@@ -69,7 +69,15 @@ abstract class Controller_Core {
// Views are straight HTML pages with embedded PHP, so importing them
// this way insures that $this can be accessed as if the user was in
// the controller, which gives the easiest access to libraries in views
- include $kohana_view_filename;
+ try
+ {
+ include $kohana_view_filename;
+ }
+ catch (Exception $e)
+ {
+ ob_end_clean();
+ throw $e;
+ }
// Fetch the output and close the buffer
return ob_get_clean();
diff --git a/system/libraries/drivers/Captcha/Alpha.php b/system/libraries/drivers/Captcha/Alpha.php
index b3a9c9d7..27795804 100644
--- a/system/libraries/drivers/Captcha/Alpha.php
+++ b/system/libraries/drivers/Captcha/Alpha.php
@@ -2,7 +2,7 @@
/**
* Captcha driver for "alpha" style.
*
- * $Id: Alpha.php 3769 2008-12-15 00:48:56Z zombor $
+ * $Id: Alpha.php 4367 2009-05-27 21:23:57Z samsoir $
*
* @package Captcha
* @author Kohana Team
@@ -81,7 +81,7 @@ class Captcha_Alpha_Driver extends Captcha_Driver {
// Draw "ghost" alphabetic character
$text_color = imagecolorallocatealpha($this->image, mt_rand($color_limit + 8, 255), mt_rand($color_limit + 8, 255), mt_rand($color_limit + 8, 255), mt_rand(70, 120));
- $char = substr($chars, mt_rand(0, 14), 1);
+ $char = $chars[mt_rand(0, 14)];
imagettftext($this->image, $size * 2, mt_rand(-45, 45), ($x - (mt_rand(5, 10))), ($y + (mt_rand(5, 10))), $text_color, $font, $char);
}