浏览代码

correct auto detect

euromark 11 年之前
父节点
当前提交
5f676b6724
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Model/Behavior/SluggedBehavior.php

+ 2 - 1
Model/Behavior/SluggedBehavior.php

@@ -93,7 +93,8 @@ class SluggedBehavior extends Behavior {
 		parent::__construct($table, $config);
 
 		if (!$this->_config['length']) {
-			$this->_config['length'] = $table->schema()->column($this->_config['field'])['length'];
+			$length = $table->schema()->column($this->_config['field'])['length'];
+			$this->_config['length'] = min((int)$length, 255);
 		}
 
 		$this->_table = $table;