Bug Fix

path is empty in some test cases but strpos can't handle an empty needle so added check if path is not empty