X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=classes%2FFile_redirection.php;h=53c15bf8b213b95e43a78e937eee634151cfd973;hb=2e2519afee87009165c97026737f72634461e82b;hp=4ee43026b72cc44dc6efd6d8a02d18a3a30d778c;hpb=cff14c7e10b5125874438215fb799bccaa9337ea;p=quix0rs-gnu-social.git diff --git a/classes/File_redirection.php b/classes/File_redirection.php index 4ee43026b7..53c15bf8b2 100644 --- a/classes/File_redirection.php +++ b/classes/File_redirection.php @@ -187,13 +187,14 @@ class File_redirection extends Memcached_DataObject * may be saved. * * @param string $long_url + * @param User $user whose shortening options to use; defaults to the current web session user * @return string */ - function makeShort($long_url) { + function makeShort($long_url, $user=null) { $canon = File_redirection::_canonUrl($long_url); - $short_url = File_redirection::_userMakeShort($canon); + $short_url = File_redirection::_userMakeShort($canon, $user); // Did we get one? Is it shorter? if (!empty($short_url) && mb_strlen($short_url) < mb_strlen($long_url)) { @@ -203,8 +204,8 @@ class File_redirection extends Memcached_DataObject } } - function _userMakeShort($long_url) { - $short_url = common_shorten_url($long_url); + function _userMakeShort($long_url, User $user=null) { + $short_url = common_shorten_url($long_url, $user); if (!empty($short_url) && $short_url != $long_url) { $short_url = (string)$short_url; // store it