Core pr 6

This also contains PR5, which have not been closed yet.

Else only minor changes from last review.
We have been through this before.

[`stripos`](http://php.net/manual/en/function.stripos.php) returns a 0-indexed position of the needle or `FALSE` if the needle is not found. [`empty`](http://php.net/manual/en/function.empty.php) returns TRUE for `0` and `FALSE`.

If we want to test if needle is a substring not located at the start of the string [`empty`] should be fine.

Again: Care to elaborate @pjohans?