diff --git a/app/sdks/MyCaptcha.class.php b/app/sdks/MyCaptcha.class.php index 3833230..9f5f5dc 100755 --- a/app/sdks/MyCaptcha.class.php +++ b/app/sdks/MyCaptcha.class.php @@ -30,12 +30,12 @@ class MyCaptcha{ for($i=0;$i<$fontfile_width && $symbol<$alphabet_length;$i++){ $transparent = (imagecolorat($font, $i, 0) >> 24) == 127; if(!$reading_symbol && !$transparent){ - $font_metrics[$alphabet{$symbol}]=array('start'=>$i); + $font_metrics[$alphabet[$symbol]]=array('start'=>$i); $reading_symbol=true; continue; } if($reading_symbol && $transparent){ - $font_metrics[$alphabet{$symbol}]['end']=$i; + $font_metrics[$alphabet[$symbol]]['end']=$i; $reading_symbol=false; $symbol++; continue; @@ -51,7 +51,7 @@ class MyCaptcha{ $odd=mt_rand(0,1); if($odd==0) $odd=-1; for($i=0;$i<$length;$i++){ - $m=$font_metrics[$this->keystring{$i}]; + $m=$font_metrics[$this->keystring[$i]]; $y=(($i%2)*$fluctuation_amplitude - $fluctuation_amplitude/2)*$odd + mt_rand(-round($fluctuation_amplitude/3), round($fluctuation_amplitude/3)) @@ -149,7 +149,7 @@ class MyCaptcha{ while(true){ $str = ''; for($i=0;$i<$length;$i++){ - $str .= $allowed_symbols{mt_rand(0,strlen($allowed_symbols)-1)}; + $str .= $allowed_symbols[mt_rand(0,strlen($allowed_symbols)-1)]; } if(!preg_match('/cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|ww/',$str)) break; }