best condition to avoid warning in strpos when  empty string

To avoid throw a warning advise when *strpos* is searching in a *$targetDir* empty.
This sentences are executed when ```$targetDir = '/something'``` 
This stopped my scripts and no assets are generated