function fboauth_action_url in Facebook OAuth (FBOAuth) 7
Same name and namespace in other branches
- 6 fboauth.module \fboauth_action_url()
- 7.2 fboauth.module \fboauth_action_url()
Helper function to properly encode slashes in URLs.
This function operates exactly like the core url() function, only it encodes forward-slashes as "%2f", which Drupal intentionally avoids in its own url() function. Encoded slashes are necessary to prevent Facebook from rejecting the return_uri property.
2 calls to fboauth_action_url()
- fboauth_access_token in includes/
fboauth.fboauth.inc - Given an approval code from Facebook, return an access token.
- fboauth_action_link_properties in ./
fboauth.module - Return a set of properties suitable for use to a url() call.
File
- ./
fboauth.module, line 396
Code
function fboauth_action_url($path = NULL, array $options = array()) {
$url = url($path, $options);
$query_pos = strpos($url, '?');
if ($query_pos !== FALSE) {
$url_string = substr($url, 0, $query_pos);
$query_string = substr($url, $query_pos);
$url = $url_string . str_replace('/', '%2F', $query_string);
}
return $url;
}