Permalink
Browse files

Fix Captcha

  • Loading branch information...
1 parent d7ad299 commit b737e68d687ef75b46f6675e1755d88513c49b4f @cdujeu cdujeu committed May 26, 2016
@@ -1071,7 +1071,6 @@ public function output()
}
imagedestroy($this->im);
- exit;
}
/**
@@ -209,6 +209,7 @@ public function read($length)
{
call_user_func($this->callback);
$this->callbackExecuted = true;
+ return "";
}
/**
@@ -220,7 +221,7 @@ public function read($length)
*/
public function getContents()
{
- $this->read(0);
+ return $this->read(0);
}
/**
@@ -38,7 +38,7 @@ class CaptchaProvider
*/
public static function sendCaptcha()
{
- $libPath = AJXP_BIN_FOLDER."/securimage";
+ $libPath = AJXP_BIN_FOLDER."/lib/securimage";
$img = new \Securimage();
$img->wordlist_file = $libPath."/words/words.txt";
@@ -157,7 +157,14 @@ public function switchAction(\Psr\Http\Message\ServerRequestInterface &$requestI
case "get_captcha":
$x = new \Pydio\Core\Http\Response\AsyncResponseStream(function(){
+ restore_error_handler();
+ restore_exception_handler();
+ set_error_handler(function ($code, $message, $script) {
+ if(error_reporting() == 0) return;
+ \Pydio\Log\Core\AJXP_Logger::error("Captcha", "Error while loading captcha : ".$message, []);
+ });
CaptchaProvider::sendCaptcha();
+ return "";
});
$responseInterface = $responseInterface->withBody($x);
break;

0 comments on commit b737e68

Please sign in to comment.