prefix) && $lang->prefix == $args[0] ) { $prefix = array_shift($args); $path_language = $lang->language; $language = $lang; } } } if (count($args)) { $path = implode('/', $args); // remaining args $alias = drupal_lookup_path('source', $path, $path_language); //can't use drupal_get_normal_path, it calls custom_url_rewrite_inbound if ($alias) $path = $alias; } else { // frontpage $path = variable_get('site_frontpage', 'node'); $alias = drupal_lookup_path('source', $path, $path_language); if ($alias) $path = $alias; $_REQUEST['destination'] = $path; //required workaround for compatibility with Global Redirect module, best practice? } } } else { //resolve aliases for non-fb-callbacks $alias = drupal_lookup_path('source', $path, $path_language); if ($alias) $path = $alias; } $result = $path; }