You are here

function fb_scrub_urls in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 5.2 fb.module \fb_scrub_urls()
  2. 5 fb.module \fb_scrub_urls()
  3. 6.3 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_url_rewrite.inc). This will remove the extra information.

2 calls to fb_scrub_urls()
fb_add_js in ./fb.module
Helper function for FBJS files.
fb_canvas_fb in ./fb_canvas.module
Implementation of hook_fb().

File

./fb.module, line 773

Code

function fb_scrub_urls($content) {
  if (function_exists('_fb_settings_url_rewrite_prefixes')) {
    foreach (_fb_settings_url_rewrite_prefixes() as $key) {
      $patterns[] = "|{$key}/[^/]*/|";
      $replacements[] = "";
    }
    $content = preg_replace($patterns, $replacements, $content);
  }
  return $content;
}