=$auth_sister_len_min)&&($len<=$auth_sister_len_max)){ //処理モード switch($mode): case 0://入力されたすべての文字列を含む if(mb_strstr($answer,$select,0,"UTF-8")) { $auth = true; } break; case 1://正規表現による if(mb_ereg($answer,$select)) { $auth = true; } break; case 2://完全一致 if($answer==$select) { $auth = true; } break; default://入力されたすべての文字列を含む if(mb_strstr($answer,$select,0,"UTF-8")) { $auth = true; } endswitch; //逆処理 if($_SESSION['auth_sister_rebirth']==1){ if($auth) { $auth = false; } else { $auth = true; } } //認証結果文 if($auth){ $_SESSION['auth_sister_res'] = $_SESSION['auth_sister_res_true']; } else { $_SESSION['auth_sister_res'] = $_SESSION['auth_sister_res_false']; } //文字数エラー } else { $_SESSION['auth_sister_res'] = $auth_sister_outlen; $auth = false; } } return($auth); } //認証成功・失敗メッセージを返します function auth_sister_res(){ require('auth_sister/config.inc.php'); $res = $auth_sister_mes_a.$_SESSION['auth_sister_res'].$auth_sister_mes_b; return($res); } //イメージ出力----------------------------------------------------------- $mode = $_GET['mode']; switch($mode): case "img": require('config.inc.php'); if($ses_name) {session_name($ses_name);} if($ses_dir) {session_save_path($ses_dir);} session_start(); if($_SESSION['auth_sister_ticket']){ require($auth_sister_load.'/config.inc.php'); putenv('GDFONTPATH=' . realpath($auth_sister_fpath)); header("Content-type: image/png"); $text=$_SESSION['auth_sister_question']; $text=mb_convert_encoding($text, "UTF-8", "auto"); $img = imagecreatefrompng($auth_sister_load.'/'.$auth_sister_image); $color = imagecolorallocate($img,0x11,0x11,0x11); //文字色 imagettftext($img, $auth_sister_fsize, 0, $auth_sister_fx, $auth_sister_fy, $color, $auth_sister_font, $text ); //画像形式 if($_GET['type']==".png"){ imagepng($img); } /* if($_GET['type']==".jpg"){ imagejpeg($img,NULL,100) } */ imagedestroy($img); $_SESSION['auth_sister_ticket'] = false; }else{ echo "Forbidden"; } break; endswitch; ?>