fix IP filter issue

- Code now trims whitespace
- Code now uses an intermediate variable for $address