You are here

function fb_scrub_urls in Drupal for Facebook 5.2

Same name and namespace in other branches
  1. 5 fb.module \fb_scrub_urls()
  2. 6.3 fb.module \fb_scrub_urls()
  3. 6.2 fb.module \fb_scrub_urls()
  4. 7.3 fb.module \fb_scrub_urls()

This method will clean up URLs. When serving canvas pages, extra information is included in URLs (see fb_settings.inc). This will remove the extra information.

3 calls to fb_scrub_urls()
fb_add_js in ./fb.module
Helper function for FBJS files.
fb_user_create_local_user in ./fb_user.module
Creates a local Drupal account for the specified facebook user id.
fb_user_fb in ./fb_user.module
Implementation of hook_fb.

File

./fb.module, line 597

Code

function fb_scrub_urls($content) {
  foreach (array(
    FB_SETTINGS_APP_NID,
    FB_SETTINGS_PAGE_TYPE,
  ) as $key) {
    $patterns[] = "|{$key}/[^/]*/|";
    $replacements[] = "";
  }
  $content = preg_replace($patterns, $replacements, $content);
  return $content;
}