Skip to content

Commit

Permalink
更新http 一个bug
Browse files Browse the repository at this point in the history
  • Loading branch information
东流 committed Apr 18, 2018
1 parent 8801821 commit c80bb87
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
36 changes: 17 additions & 19 deletions Common/DataValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,56 @@

/**
* DataValidator 过滤器
*
*
* @package ultraman\Tools
* @copyright Copyright (c) 2017, ultraman
*/

namespace ultraman\Common;

use ultraman\Common\CommonFun;

class DataValidator
{

const INT = 'int';
const NUMBER = 'number';
const BOOL = 'bool';

/**
* Emoji表情处理
/**
* Emoji表情处理
* @param $str 处理的表情字符
*/
*/

public static function filterEmoji($str)
public static function filterEmoji($str)
{
$str = preg_replace_callback(
'/./u',
function (array $match) {
return strlen($match[0]) >= 4 ? '' : $match[0];
},
$str);
$str
);

return $str;
return $str;
}


public static function Student($_supports,$params)
public static function Student($_supports, $params)
{
$items = [];
foreach ($_supports as $key => $value) {
if(is_array($value) || $value == ""){
if (is_array($value) || $value == "") {
continue;
}
$count = substr_count($value,'|');
if($count!=0){
$str = CommonFun::explode_keys("|",$value);
}else{
$count = substr_count($value, '|');
if ($count!=0) {
$str = CommonFun::explode_keys("|", $value);
} else {
$str[0] = trim($value);
$str[1] = "string";
}
$item = isset($params[$str[0]])?$params[$str[0]]:"";
$items[$key] = CommonFun::Types($item,$str[1]);
$items[$key] = CommonFun::Types($item, $str[1]);
}
return $items;
}
Expand All @@ -72,7 +73,4 @@ public static function validate($variable, $accept_type, $required = false)
return true;
}
}



}
}
2 changes: 2 additions & 0 deletions Foundation/OpenSign.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public static function Auth($params, $common)
if (!isset($header['appkey']) || $header['appkey'] !=$common['appkey']) {
throw new \Exception("header sign is Error", 400);
}
\ultraman\Log\monoLog::write("INFO", $header);

$timestamp = $header['timestamp'];
$time = time();
$last = $time - 10 * 60;
Expand Down
2 changes: 1 addition & 1 deletion Http/HttpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct($config)
}

if ($config['host'] == '' || $config['port'] == '') {
throw new Exception("服务器配置错误", Ecode::ERROR);
throw new \Exception("服务器配置错误", Ecode::ERROR);
}
static::$_config = $config;
}
Expand Down

0 comments on commit c80bb87

Please sign in to comment.