Fix EZP-23364

This should also be moved to a new protected method, e.g. `removePathPrefix( $path, $prefix )`, so that repetition below is avoided.