return common_replace_urls_callback($text, array('File_redirection', 'forceShort'), $user);
} else {
return common_replace_urls_callback($text, array('File_redirection', 'forceShort'), $user);
} else {
return common_replace_urls_callback($text, array('File_redirection', 'makeShort'), $user);
}
}
return common_replace_urls_callback($text, array('File_redirection', 'makeShort'), $user);
}
}
$long_url = trim($long_url);
$user = common_current_user();
$maxUrlLength = User_urlshortener_prefs::maxUrlLength($user);
$long_url = trim($long_url);
$user = common_current_user();
$maxUrlLength = User_urlshortener_prefs::maxUrlLength($user);
// $force forces shortening even if it's not strictly needed
// I doubt URL shortening is ever 'strictly' needed. - ESP
if (mb_strlen($long_url) < $maxUrlLength && !$force) {
// $force forces shortening even if it's not strictly needed
// I doubt URL shortening is ever 'strictly' needed. - ESP
if (mb_strlen($long_url) < $maxUrlLength && !$force) {
if (Event::handle('StartShortenUrl',
array($long_url, $shortenerName, &$shortenedUrl))) {
if ($shortenerName == 'internal') {
if (Event::handle('StartShortenUrl',
array($long_url, $shortenerName, &$shortenedUrl))) {
if ($shortenerName == 'internal') {