Remove legacy code

Use basename instead of strrpos
Use basename instead of strrpos
Use basename instead of strrpos
Merge pull request #199 from acidvertigo/patch-1

Use basename instead of substr strrpos