Skip to content

Commit

Permalink
improved gii input filter, fixes #3689
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Jun 4, 2014
1 parent 91722d0 commit a643bde
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extensions/gii/generators/model/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public function rules()
{
return array_merge(parent::rules(), [
[['db', 'ns', 'tableName', 'modelClass', 'baseClass'], 'filter', 'filter' => 'trim'],
[['ns'], 'filter', 'filter' => function($value) { return trim($value, '\\'); }],

[['db', 'ns', 'tableName', 'baseClass'], 'required'],
[['db', 'modelClass'], 'match', 'pattern' => '/^\w+$/', 'message' => 'Only word characters are allowed.'],
[['ns', 'baseClass'], 'match', 'pattern' => '/^[\w\\\\]+$/', 'message' => 'Only word characters and backslashes are allowed.'],
Expand Down

0 comments on commit a643bde

Please sign in to comment.