Handle trailing URL segments in router
Added logic to handle single trailing URL segments in the router, ensuring non-numeric segments are added to the `$_REQUEST` array if not already present. Improved URL parsing for consistent request handling.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Nibiru;
|
namespace Nibiru;
|
||||||
|
use phpseclib3\File\ASN1\Maps\FieldElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User - stephan
|
* User - stephan
|
||||||
* Date - 24.01.17
|
* Date - 24.01.17
|
||||||
@@ -250,7 +252,17 @@ class Router extends Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Handle single trailing URL segments
|
||||||
|
if(!is_numeric($uri_parts[$i]) && !empty($uri_parts[$i]))
|
||||||
|
{
|
||||||
|
if(!array_key_exists($uri_parts[$i], $_REQUEST))
|
||||||
|
{
|
||||||
|
$_REQUEST[$uri_parts[$i]] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user