X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=8c8db66a9eee938f90be5b1b476d9b3503003ec2;hb=91d1ef36d8e2bd117160418cb82a39c7b2353c91;hp=64f6f72a8c8244d556067b5a4d6f01e480d1071f;hpb=0cf2e051bbe98166e99025bc1f32a6e8e08a26f2;p=friendica.git
diff --git a/include/text.php b/include/text.php
index 64f6f72a8c..8c8db66a9e 100644
--- a/include/text.php
+++ b/include/text.php
@@ -80,6 +80,9 @@ function escape_tags($string) {
if(! function_exists('autoname')) {
function autoname($len) {
+ if($len <= 0)
+ return '';
+
$vowels = array('a','a','ai','au','e','e','e','ee','ea','i','ie','o','ou','u');
if(mt_rand(0,5) == 4)
$vowels[] = 'y';
@@ -225,6 +228,9 @@ if(! function_exists('paginate')) {
function paginate(&$a) {
$o = '';
$stripped = preg_replace('/(&page=[0-9]*)/','',$a->query_string);
+
+// $stripped = preg_replace('/&zrl=(.*?)([\?&]|$)/ism','',$stripped);
+
$stripped = str_replace('q=','',$stripped);
$stripped = trim($stripped,'/');
$pagenum = $a->pager['page'];
@@ -725,6 +731,8 @@ function smilies($s, $sample = false) {
'\\o/',
'o.O',
'O.o',
+ 'o_O',
+ 'O_o',
":'(",
":-!",
":-/",
@@ -759,6 +767,8 @@ function smilies($s, $sample = false) {
'
',
'
',
'
',
+ '
',
+ '
',
'
',
'
',
'
',
@@ -920,7 +930,7 @@ function prepare_body($item,$attach = false) {
foreach($matches as $mtch) {
if(strlen($x))
$x .= ',';
- $x .= file_tag_decode($mtch[1]);
+ $x .= xmlify(file_tag_decode($mtch[1]));
}
if(strlen($x))
$s .= '
' . t('Categories:') . ' ' . $x . '
';
@@ -935,7 +945,7 @@ function prepare_body($item,$attach = false) {
foreach($matches as $mtch) {
if(strlen($x))
$x .= ' ';
- $x .= file_tag_decode($mtch[1]). ' ' . t('[remove]') . '';
+ $x .= xmlify(file_tag_decode($mtch[1])) . ' ' . t('[remove]') . '';
}
if(strlen($x) && (local_user() == $item['uid']))
$s .= '' . t('Filed under:') . ' ' . $x . '
';
@@ -1058,10 +1068,12 @@ function unamp($s) {
if(! function_exists('lang_selector')) {
function lang_selector() {
global $lang;
- $o = '';
- $o .= '';
- $o .= '
';
+
+ $tpl = get_markup_template("lang_selector.tpl");
+ $o = replace_macros($tpl, array(
+ '$title' => t('Select an alternate language'),
+ '$langs' => array($lang_options, $selected),
+
+ ));
return $o;
}}
@@ -1307,16 +1324,125 @@ function file_tag_decode($s) {
function file_tag_file_query($table,$s,$type = 'file') {
- // this is ultimately going into a vsprintf
- $s = str_replace('%','%%',$s);
-
if($type == 'file')
- $str = preg_quote( '[' . file_tag_encode($s) . ']' );
+ $str = preg_quote( '[' . str_replace('%','%%',file_tag_encode($s)) . ']' );
else
- $str = preg_quote( '<' . file_tag_encode($s) . '>' );
+ $str = preg_quote( '<' . str_replace('%','%%',file_tag_encode($s)) . '>' );
return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' ";
}
+// ex. given music,video return