') { // Do we really have to do this here? $path = ''; } $path = $pre . (!empty($options['prefix']) ? $options['prefix'] : '') . $path; // We have manually set the prefix, so remove the options prefix. $options['prefix'] = ''; } // Since we called fb_canvas_url_alter already, supress it from acting again. $options['fb_url_alter'] = FALSE; } /** * Implements hook_url_inbound_alter(). * * Rewrite URLs for facebook canvas pages, and connect callbacks. * */ function fb_url_inbound_alter(&$path, $original_path, $path_language) { global $language; // See if this is a request for us. if (strpos($path, FB_SETTINGS_CB . '/') === 0) { // Too soon for arg() function. $args = explode('/', $path); while (count($args) && in_array($args[0], _fb_settings_url_rewrite_prefixes())) { $key = array_shift($args); $value = array_shift($args); if (fb_settings($key) === NULL) // defer to previously set values fb_settings($key, $value); // Store for use later. } // Remove our prefixes $path = implode('/', $args); // Because Drupal calls hook_url_inbound_alter() later than it should, we have to repeat this work, which path.inc has already done. if (!$path) { $path = variable_get('site_frontpage', 'node'); } $alias = drupal_lookup_path('source', $path, $path_language); if ($alias) { $path = $alias; } } $result = $path; }