Skip to content

Commit

Permalink
fix: username xss vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
liufee committed Nov 3, 2019
1 parent 66a5109 commit e92f687
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Exception;
use Yii;
use common\helpers\Util;
use yii\helpers\Html;

/**
* User model
Expand Down Expand Up @@ -103,4 +104,9 @@ public function beforeDelete()
return true;
}

public function afterFind(){
parent::afterFind();
$this->username = Html::encode($this->username);
}

}

0 comments on commit e92f687

Please sign in to comment.