Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292913

function menu_item_route_access() does not catch a ResourceNotFoundException as expected from RequestMatcherInterface

$
0
0

in menu.inc:

<?php
function menu_item_route_access(Route $route, $href, &$map) {
 
$request = Request::create('/'. $href);
 
$request->attributes->set('system_path', $href);
 
// Attempt to match this path to provide a fully built request to the
  // access checker.
 
try {
   
$request->attributes->add(Drupal::service('router.dynamic')->matchRequest($request));
  }
  catch (
NotFoundHttpException $e) {
    return
FALSE;
  }
?>

Results in an uncaught exception if you pass in a bad $href that isn't a real system path. On the RequestMatcherInterface that's documented as the exception that will be thrown.


Viewing all articles
Browse latest Browse all 292913

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>