Merge branch '1.12RC'
This commit is contained in:
@@ -1179,6 +1179,7 @@ function smilies($s, $sample = false) {
|
||||
$s = preg_replace_callback('{<(pre|code)>.*?</\1>}ism', 'smile_shield', $s);
|
||||
$s = preg_replace_callback('/<[a-z]+ .*?>/ism', 'smile_shield', $s);
|
||||
|
||||
|
||||
$params = list_smilies();
|
||||
$params['string'] = $s;
|
||||
|
||||
@@ -1192,6 +1193,7 @@ function smilies($s, $sample = false) {
|
||||
$s = str_replace($params['texts'],$params['icons'],$params['string']);
|
||||
}
|
||||
|
||||
|
||||
$s = preg_replace_callback('/<!--base64:(.*?)-->/ism', 'smile_unshield', $s);
|
||||
|
||||
return $s;
|
||||
@@ -1204,11 +1206,11 @@ function smilies($s, $sample = false) {
|
||||
* @return string
|
||||
*/
|
||||
function smile_shield($m) {
|
||||
return '<!--base64:' . base64url_encode($m[0]) . '-->';
|
||||
return '<!--base64:' . base64special_encode($m[0]) . '-->';
|
||||
}
|
||||
|
||||
function smile_unshield($m) {
|
||||
return base64url_decode($m[1]);
|
||||
return base64special_decode($m[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1603,7 +1605,9 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) {
|
||||
$s = bbcode($text,false,true,$cache);
|
||||
else
|
||||
$s = smilies(bbcode($text,false,true,$cache));
|
||||
|
||||
$s = zidify_links($s);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1853,6 +1857,26 @@ function base64url_decode($s) {
|
||||
return base64_decode(strtr($s,'-_','+/'));
|
||||
}
|
||||
|
||||
|
||||
function base64special_encode($s, $strip_padding = true) {
|
||||
|
||||
$s = strtr(base64_encode($s),'+/',',.');
|
||||
|
||||
if($strip_padding)
|
||||
$s = str_replace('=','',$s);
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
function base64special_decode($s) {
|
||||
if(is_array($s)) {
|
||||
logger('base64url_decode: illegal input: ' . print_r(debug_backtrace(), true));
|
||||
return $s;
|
||||
}
|
||||
return base64_decode(strtr($s,',.','+/'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ Return a div to clear floats.
|
||||
*
|
||||
@@ -2250,6 +2274,34 @@ function design_tools() {
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates website import tools menu
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function website_import_tools() {
|
||||
|
||||
$channel = App::get_channel();
|
||||
$sys = false;
|
||||
|
||||
if(App::$is_sys && is_site_admin()) {
|
||||
require_once('include/channel.php');
|
||||
$channel = get_sys_channel();
|
||||
$sys = true;
|
||||
}
|
||||
|
||||
return replace_macros(get_markup_template('website_import_tools.tpl'), array(
|
||||
'$title' => t('Import'),
|
||||
'$import_label' => t('Import website...'),
|
||||
'$import_placeholder' => t('Select folder to import'),
|
||||
'$file_upload_text' => t('Import from a zipped folder:'),
|
||||
'$file_import_text' => t('Import from cloud files:'),
|
||||
'$desc' => t('/cloud/channel/path/to/folder'),
|
||||
'$hint' => t('Enter path to website files'),
|
||||
'$select' => t('Select folder'),
|
||||
));
|
||||
}
|
||||
|
||||
/* case insensitive in_array() */
|
||||
|
||||
function in_arrayi($needle, $haystack) {
|
||||
@@ -2803,6 +2855,12 @@ function expand_acl($s) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function acl2json($s) {
|
||||
$s = expand_acl($s);
|
||||
$s = json_encode($s);
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
// When editing a webpage - a dropdown is needed to select a page layout
|
||||
// On submit, the pdl_select value (which is the mid of an item with item_type = ITEM_TYPE_PDL) is stored in
|
||||
|
||||
Reference in New Issue
Block a user