mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
Fix missing return from translate_scope function
Also make sure the output is escaped wherever this function is used.
This commit is contained in:
@@ -110,7 +110,7 @@ class Lockview extends Controller {
|
||||
// as unknown specific recipients. The sender will have the visibility list and will fall through to the
|
||||
// next section.
|
||||
|
||||
echo '<div class="dropdown-item-text">' . translate_scope((!$item['public_policy']) ? 'specific' : $item['public_policy']) . '</div>';
|
||||
echo '<div class="dropdown-item-text">' . escape_tags(translate_scope((!$item['public_policy']) ? 'specific' : $item['public_policy'])) . '</div>';
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
@@ -841,7 +841,7 @@ class Profiles extends \Zotlabs\Web\Controller {
|
||||
'$alt' => t('Profile Image'),
|
||||
'$profile_name' => $rr['profile_name'],
|
||||
'$visible' => (($rr['is_default'])
|
||||
? '<strong>' . translate_scope(map_scope(\Zotlabs\Access\PermissionLimits::Get($channel['channel_id'],'view_profile'))) . '</strong>'
|
||||
? '<strong>' . escape_tags(translate_scope(map_scope(\Zotlabs\Access\PermissionLimits::Get($channel['channel_id'],'view_profile')))) . '</strong>'
|
||||
: '<a href="' . z_root() . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>')
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1272,7 +1272,7 @@ function map_scope($scope, $strip = false) {
|
||||
* @param string $scope
|
||||
* @return string translated string describing the scope
|
||||
*/
|
||||
function translate_scope($scope) {
|
||||
function translate_scope($scope): string {
|
||||
if(! $scope || $scope === 'public')
|
||||
return t('Visible to anybody on the internet.');
|
||||
if(strpos($scope,'self') === 0)
|
||||
@@ -1289,6 +1289,9 @@ function translate_scope($scope) {
|
||||
return t('Visible to approved connections.');
|
||||
if(strpos($scope,'specific') === 0)
|
||||
return t('Visible to specific connections.');
|
||||
|
||||
// Fall through and return untranslated scope
|
||||
return $scope;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
|
||||
|
||||
{{if $is_default}}
|
||||
<div class="section-content-info-wrapper">{{$default}}</div>
|
||||
<div class="section-content-info-wrapper">{{$default | escape:'html'}}</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="panel-group" id="profile-edit-wrapper" role="tablist" aria-multiselectable="true">
|
||||
|
||||
Reference in New Issue
Block a user