Browse Source

correct auto detect

euromark 11 years ago
parent
commit
5f676b6724
1 changed files with 2 additions and 1 deletions
  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;