Fixes #1170 - PIN issues during upgrade

#1170
fixes for config.php that have spaces in end of file
for example:
```php
<?php
.
.
.
?>     
```