diff --git a/fb_url_rewrite.inc b/fb_url_rewrite.inc index 6531258..1fc5639 100644 --- a/fb_url_rewrite.inc +++ b/fb_url_rewrite.inc @@ -145,13 +145,7 @@ function fb_url_outbound_alter(&$path, &$options, $original_path) { * Rewrite URLs for facebook canvas pages, and connect callbacks. * */ -function fb_url_inbound_alter(&$result, $path, $path_language) { - global $language; - - // Check language configuration mode. - $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE); - - //dpm(func_get_args(), 'fb_settings_url_rewrite_outbound'); // debug +function fb_url_inbound_alter(&$path, $original_path, $path_language) { // See if this is a request for us. if (strpos($path, FB_SETTINGS_CB . '/') === 0) { // Too soon for arg() function. @@ -159,49 +153,11 @@ function fb_url_inbound_alter(&$result, $path, $path_language) { 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 + if (fb_settings($key) === NULL) { fb_settings($key, $value); // Store for use later. - } - if (fb_settings(FB_SETTINGS_CB)) { - - // Check for language prefix. - if ( count($args) && ( $mode == LANGUAGE_NEGOTIATION_PATH || $mode == LANGUAGE_NEGOTIATION_PATH_DEFAULT ) ) { - - // Get list of enabled languages. - $languages = language_list('enabled'); - $languages = $languages[1]; - - foreach ( $languages as $lang ) { - if ( !empty($lang->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? } } + $path = implode('/', $args); } - else { //resolve aliases for non-fb-callbacks - $alias = drupal_lookup_path('source', $path, $path_language); - if ($alias) - $path = $alias; - } - - $result = $path; }