canvas;
}
$patterns = array();
$replacements = array();
$base_path = base_path();
if ($_fb) {
if (function_exists('fb_url_outbound_alter')) {
$rewrite_options = array(FB_SETTINGS_CB_SESSION => FALSE, FB_SETTINGS_CB_TYPE => FALSE);
$base_rewrite = '';
fb_url_outbound_alter($base_rewrite, $rewrite_options, '');
$base = $base_path . $base_rewrite; // short URL with rewrite applied.
}
else {
// If no url_alter, use normal base_path.
$base = $base_path;
}
$protocol = fb_protocol(); // http or https
if (isset($options['to_canvas']) && ($canvas = $options['to_canvas'])) {
// Make relative links point to canvas pages.
$patterns[] = "|]*)href=\"{$base}|";
$replacements[] = "', array(
'absolute' => TRUE,
'fb_url_alter' => FALSE,
));
$patterns[] = "|]*)href=\"{$base}|";
$replacements[] = "]*)href=\"|";
$replacements[] = "]*)action=\"([^:\"]*):|";
$replacements[] = "