Update BaseSecurity.php

prevent call strlen function twice
Merge pull request #1525 from dizews/patch-1

Update BaseSecurity.php