Can this ever be executed? Shouldn't the regexp actually check for / and .. ? Looks like this isn't your code sorry but it shows up in the diff.