这是从https://github.com/lucadegasperi/oauth2-server-laravel迁移的表
在表中oauth_clients,id的字段数据类型是varchar(40),而不是int.
$name = Input::get('name');
$id = str_random(40);
$secret = str_random(40);
$client = new oauthClient;
$client->name = $name;
$client->id = $id;
$client->secret = $secret;
$client->save();
Run Code Online (Sandbox Code Playgroud)
保存后(); $ client-> id变为'0',而不是我指定的字符串.
这使得以下关系表保存失败.
$endpoint = new OauthClientEndpoint(array('redirect_uri' => Input::get('redirect_uri));
$client->OauthClientEndpoint()->save($endpoint);
Run Code Online (Sandbox Code Playgroud)
我检查了$client->id:保存后,它变为0,我得到一个错误,包括这个:
(SQL: insert into `oauth_client_endpoints` (`redirect_uri`, `client_id`, `updated_at`, `created_at`) values (http://www.xxxxx.com, 0, 2014-09-01 11:10:16, 2014-09-01 11:10:16))
Run Code Online (Sandbox Code Playgroud)
我手动保存了一个端点以防止此错误.但是我该如何解决这个问题呢?
这是我的模特:
class OauthClient extends Eloquent {
protected $table = 'oauth_clients';
public function OauthClientEndpoint(){
return $this->hasOne('OauthClientEndpoint', 'client_id', 'id');
}
}
class …Run Code Online (Sandbox Code Playgroud) 这是一个聊天室,有一个 div .words 作为容器,里面有一个 .content div。
我希望文本从 .content 的底部显示,所以我使用position:absolute,bottom:0; 关于.内容。但我希望它在 .content 增长高于 .words 时显示滚动条。所以我在.words 上添加了overflow:auto。
如果我删除bottom:0,overflow:auto将正常工作。但如果bottom:0则不起作用。
如何让输入从底部显示,并且溢出时有滚动条?
CSS:
.tbchat-room{
position: fixed;
bottom:0;
width:260px;
border:1px solid #aaa;
background:#fff;
}
.tbchat-room .head{
padding: 3px 10px;
background:#3d9ac1;
color:#fff;
}
.tbchat-room .words{
height:230px;
background:#ececec;
overflow:auto;
position:relative;
}
.tbchat-room .words .content{
position:absolute;
}
.tbchat-room .say{
width:246px;
margin:0;
border-top: 1px solid #ccc;
border-bottom: 0;
border-left: 0;
border-right: 0;
padding:4px 6px;
}
.pull-right{
float:right;
}
.content{
padding:5px 10px;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<div class="tbchat-room">
<div class="head">
<span class="title">Chat Room</span> …Run Code Online (Sandbox Code Playgroud) 我使用crypt()来哈希密码,像这样的河豚盐:
[a-zA-Z0-9] $ 2a $,2位数,$,21个字符
在这里我犯了一个错误,在第三个$ 21之后的字符长度不是22.但它工作正常所以我没有找到错误.
它适用于运行Windows和PHP 5.4.4的桌面以及使用php 5.3.x运行Amazon linux的AWS ec2,其中包含太短的盐.
有一天,我将AWS php更新为5.5.14.然后问题发生了.crypt()一直返回*0.
经过一番尝试,我在盐的末尾加了一个$,所以它变成22个字符.它再次工作并返回与以前相同的哈希字符串.虽然它不遵守河豚规则,但字符应为[./a-zA-Z0-9]
但是现在我将这个站点复制到另一台运行openSuSE 13.1和php 5.5.14的机器上,这个盐再次失败了.
我将php降级到5.4.20,但没有帮助.
新站点仍然需要旧数据库,所以我必须使密码哈希工作.
什么是影响此河豚盐长度错误兼容性问题的库或模块?Tt似乎不是PHP的版本.AWS 5.5.14
或者是否有另一个神奇的咒语可以再次救我?我尝试在[./a-zA-Z0-9]中为每个替换尾部$但是没有幸运,哈希字符串是不同的....