forked from GNUsocial/gnu-social
Merge branch 'testing' into 0.9.x
This commit is contained in:
35
lib/util.php
35
lib/util.php
@@ -862,7 +862,14 @@ function common_xml_safe_str($str)
|
||||
function common_tag_link($tag)
|
||||
{
|
||||
$canonical = common_canonical_tag($tag);
|
||||
$url = common_local_url('tag', array('tag' => $canonical));
|
||||
if (common_config('singleuser', 'enabled')) {
|
||||
// regular TagAction isn't set up in 1user mode
|
||||
$url = common_local_url('showstream',
|
||||
array('nickname' => common_config('singleuser', 'nickname'),
|
||||
'tag' => $canonical));
|
||||
} else {
|
||||
$url = common_local_url('tag', array('tag' => $canonical));
|
||||
}
|
||||
$xs = new XMLStringer();
|
||||
$xs->elementStart('span', 'tag');
|
||||
$xs->element('a', array('href' => $url,
|
||||
@@ -1272,12 +1279,38 @@ function common_mtrand($bytes)
|
||||
return $enc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Record the given URL as the return destination for a future
|
||||
* form submission, to be read by common_get_returnto().
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @fixme as a session-global setting, this can allow multiple forms
|
||||
* to conflict and overwrite each others' returnto destinations if
|
||||
* the user has multiple tabs or windows open.
|
||||
*
|
||||
* Should refactor to index with a token or otherwise only pass the
|
||||
* data along its intended path.
|
||||
*/
|
||||
function common_set_returnto($url)
|
||||
{
|
||||
common_ensure_session();
|
||||
$_SESSION['returnto'] = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a return-destination URL previously recorded by
|
||||
* common_set_returnto().
|
||||
*
|
||||
* @return mixed URL string or null
|
||||
*
|
||||
* @fixme as a session-global setting, this can allow multiple forms
|
||||
* to conflict and overwrite each others' returnto destinations if
|
||||
* the user has multiple tabs or windows open.
|
||||
*
|
||||
* Should refactor to index with a token or otherwise only pass the
|
||||
* data along its intended path.
|
||||
*/
|
||||
function common_get_returnto()
|
||||
{
|
||||
common_ensure_session();
|
||||
|
Reference in New Issue
Block a user