Skip to content

Commit

Permalink
Changed testing GD in Captcha, Removed loggind from shutdown
Browse files Browse the repository at this point in the history
functions, fixed XSS vulnerability in Edit controller
  • Loading branch information
snytkine committed Jun 2, 2011
1 parent 7a8b052 commit bad48b8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/Lampcms/Captcha.php
Expand Up @@ -753,8 +753,8 @@ public static function checkGD(){
}

$gd_info = gd_info();

if(empty($gd['JPEG Support']) && empty($gd['JPEG Support'])){
if(empty($gd_info['JPG Support']) && empty($gd_info['JPEG Support'])){
throw new DevException('Your php GD version does not have support for JPG image. Captcha cannot be used without JPG support in GD');
}

Expand All @@ -763,13 +763,15 @@ public static function checkGD(){
}

$gdv = $gd_info['GD Version'];
$Version = preg_replace('/[[:alpha:][:space:]()]+/', '', $gd['GD Version']);

d('$gdv: '.$gdv);
$Version = preg_replace('/[[:alpha:][:space:]()]+/', '', $gdv);
d('Version: '.$Version);

if(version_compare($Version, 2.0) < 0){
throw new DevException('GD version must be newer than 2.0. Your installed version is: '.$Version.' Captcha will not be used');
}

throw new DevException('Your php does not have the GD Library. The Captcha Class cannot be used without it');
return $Version;
}


Expand Down

0 comments on commit bad48b8

Please sign in to comment.