I think this class not work as well... In constructor RewriteEngine class we got:
for ( $i = 0 ; $i < sizeof($this->bits) ; $i++ )
{
if ( $this->bits[$i] === '' )
{
unset($this->bits[$i]);
}
}
It seems to be allright, but it's only seems. Let's analyze this.
The loop begins.
For example, let bits hold four elements. Let the second and the third elements will be ''. What happend?
First loop - OK, sizeof(bits)=4 we got sometnig, 'if' condition is false.
Second loop - OK, sizeof(bits)=4, we got empty string, 'if' condition is true, we executing unset() function.
Third loop - ERROR!! sizeof(bits) is 3!! Why? because we executed unset() function in previous loop! We unset second element, so third element is now second, and fourth is now third. Result: the oryginal third element was never checked!
OK, for example let's do this:
modify 'for' loop:
$this->bits = explode('/', $_SERVER['REQUEST_URI']);
var_dump($this->bits);
for ( $i = 0 ; $i < $aa=sizeof($this->bits) ; $i++ )
{
echo "i: ".$i." sizeof: ".$aa."<br>";
if ( $this->bits[$i] === '' )
{
unset($this->bits[$i]);
}
}
var_dump($this->bits);
Put both files in subdirectory on your server, ie. public_html/aa/
Open in browser slightly modified addres:
<jour_domain>//aa//sample.php
The result will be something like this:
nomadsoft.pl/testsite/err.png
As you see, the one empty element was missing during loop.
PS. Sorry for my bad english.