X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=71a2564405714659f472904c2f1cf1850edd13c4;hb=2148a2bdb0cb38d3a085109eeeb6acc5d65484e6;hp=508cf17461d2f7ea9f7ae1fc9fa863259b2a34a3;hpb=b6648215b80e9c31b725efd0457b1e9c5a63094e;p=friendica.git diff --git a/include/text.php b/include/text.php index 508cf17461..71a2564405 100644 --- a/include/text.php +++ b/include/text.php @@ -293,7 +293,7 @@ function paginate_data(App $a, $count = null) { $stripped = trim($stripped, '/'); $pagenum = $a->pager['page']; - if (($a->page_offset != '') AND !preg_match('/[?&].offset=/', $stripped)) { + if (($a->page_offset != '') && !preg_match('/[?&].offset=/', $stripped)) { $stripped .= '&offset=' . urlencode($a->page_offset); } @@ -425,9 +425,9 @@ function expand_acl($s) { $ret = array(); if (strlen($s)) { - $t = str_replace('<','',$s); - $a = explode('>',$t); - foreach($a as $aa) { + $t = str_replace('<', '', $s); + $a = explode('>', $t); + foreach ($a as $aa) { if (intval($aa)) { $ret[] = intval($aa); } @@ -469,8 +469,8 @@ function perms2str($p) { } if (is_array($tmp)) { - array_walk($tmp,'sanitise_acl'); - $ret = implode('',$tmp); + array_walk($tmp, 'sanitise_acl'); + $ret = implode('', $tmp); } return $ret; }} @@ -1246,7 +1246,7 @@ if (! function_exists('link_compare')) { * @return boolean True if the URLs match, otherwise False * */ -function link_compare($a,$b) { +function link_compare($a, $b) { return (strcasecmp(normalise_link($a), normalise_link($b)) === 0); }} @@ -1276,8 +1276,8 @@ function redir_private_images($a, &$item) function put_item_in_cache(&$item, $update = false) { - if (($item["rendered-hash"] != hash("md5", $item["body"])) OR ($item["rendered-hash"] == "") OR - ($item["rendered-html"] == "") OR get_config("system", "ignore_cache")) { + if (($item["rendered-hash"] != hash("md5", $item["body"])) || ($item["rendered-hash"] == "") || + ($item["rendered-html"] == "") || get_config("system", "ignore_cache")) { // The function "redir_private_images" changes the body. // I'm not sure if we should store it permanently, so we save the old value. @@ -1290,7 +1290,7 @@ function put_item_in_cache(&$item, $update = false) { $item["rendered-hash"] = hash("md5", $item["body"]); $item["body"] = $body; - if ($update AND ($item["id"] != 0)) { + if ($update && ($item["id"] != 0)) { q("UPDATE `item` SET `rendered-html` = '%s', `rendered-hash` = '%s' WHERE `id` = %d", dbesc($item["rendered-html"]), dbesc($item["rendered-hash"]), intval($item["id"])); } @@ -1312,14 +1312,14 @@ if (! function_exists('prepare_body')) { * @hook prepare_body ('item'=>item array, 'html'=>body string) after first bbcode to html * @hook prepare_body_final ('item'=>item array, 'html'=>body string) after attach icons and blockquote special case handling (spoiler, author) */ -function prepare_body(&$item,$attach = false, $preview = false) { +function prepare_body(&$item, $attach = false, $preview = false) { $a = get_app(); call_hooks('prepare_body_init', $item); - $searchpath = z_root()."/search?tag="; + $searchpath = z_root() . "/search?tag="; - $tags=array(); + $tags = array(); $hashtags = array(); $mentions = array(); @@ -1352,8 +1352,9 @@ function prepare_body(&$item,$attach = false, $preview = false) { $update = (!local_user() and !remote_user() and ($item["uid"] == 0)); // Or update it if the current viewer is the intented viewer - if (($item["uid"] == local_user()) AND ($item["uid"] != 0)) + if (($item["uid"] == local_user()) && ($item["uid"] != 0)) { $update = true; + } put_item_in_cache($item, $update); $s = $item["rendered-html"]; @@ -1371,9 +1372,8 @@ function prepare_body(&$item,$attach = false, $preview = false) { $as = ''; $vhead = false; - $arr = explode('[/attach],',$item['attach']); + $arr = explode('[/attach],', $item['attach']); if (count($arr)) { - $as .= '