1 Star 0 Fork 19

BackPack Man/PHPCMS V10 修改版

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
checkcode.php 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
找寻知音 提交于 2021-12-25 18:58 +08:00 . 初始化仓库
<?php
defined('IN_CMS') or exit('No permission resources.');
$cache = pc_base::load_sys_class('cache');
$checkcode = pc_base::load_sys_class('checkcode');
if($input->get('width') && intval($input->get('width'))) $checkcode->width = intval($input->get('width'));
if($input->get('height') && intval($input->get('height'))) $checkcode->height = intval($input->get('height'));
if($input->get('code_len') && intval($input->get('code_len'))) $checkcode->code_len = intval($input->get('code_len'));
if($input->get('font_size') && intval($input->get('font_size'))) $checkcode->font_size = intval($input->get('font_size'));
if ($input->get('font_color') && trim(urldecode($input->get('font_color'))) && preg_match('/(^#[a-z0-9]{6}$)/im', trim(urldecode($input->get('font_color'))))) $checkcode->font_color = trim(urldecode($input->get('font_color')));
if ($input->get('background') && trim(urldecode($input->get('background'))) && preg_match('/(^#[a-z0-9]{6}$)/im', trim(urldecode($input->get('background'))))) $checkcode->background = trim(urldecode($input->get('background')));
if($checkcode->width > 500 || $checkcode->width < 10) $checkcode->width = 100;
if($checkcode->height > 300 || $checkcode->height < 10) $checkcode->height = 35;
if($checkcode->code_len > 8 || $checkcode->code_len < 2) $checkcode->code_len = 4;
if($checkcode->font_size > 50 || $checkcode->font_size < 14) $checkcode->font_size = 20;
$checkcode->show_code();
$cache->set_auth_data('web-captcha-'.md5($input->ip_address().$input->get_user_agent()), $checkcode->get_code(), 1);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/boyadmin/phpcms.git
git@gitee.com:boyadmin/phpcms.git
boyadmin
phpcms
PHPCMS V10 修改版
master

搜索帮助