Based on the current callers of this method it is impossible that an empty
string is passed in:
- In LookupRequestRoute the matched controller will always contain a non-slash
character, unless the URL itself only consists of slashes, which is rejected
early.
- In ControllerMap::lookupDefaultController() the method will only be called if
the `routePart` of the landing page matches `__WCF_CMS__` which is only the
case if the page does not have an controller assigned. In that case the invariant
that a custom URL must be configured holds and `->lookupCmsPage()` will not
return an empty controller value.
*/
public function resolveCustomController($application, $controller)
{
+ if ($controller === '') {
+ throw new \InvalidArgumentException('The given controller must not be empty.');
+ }
+
if (isset($this->applicationOverrides['lookup'][$application][$controller])) {
$application = $this->applicationOverrides['lookup'][$application][$controller];
}