Update BaseSecurity.php

prevent call strlen function twice