Browse Source

added spaces + some curly braces

Signed-off-by: Roland Häder <roland@mxchange.org>
pull/3112/head
Roland Häder 4 years ago
committed by Roland Haeder
parent
commit
ed0d858f98
No known key found for this signature in database GPG Key ID: B72F8185C6C7BD78
6 changed files with 27 additions and 18 deletions
  1. +5
    -4
      include/contact_widgets.php
  2. +15
    -9
      include/conversation.php
  3. +2
    -2
      include/dfrn.php
  4. +1
    -1
      include/ostatus.php
  5. +2
    -1
      include/security.php
  6. +2
    -1
      include/text.php

+ 5
- 4
include/contact_widgets.php View File

@ -172,10 +172,11 @@ function categories_widget($baseurl,$selected = '') {
$matches = false;
$terms = array();
$cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
if ($cnt) {
foreach ($matches as $mtch) {
$unescaped = xmlify(file_tag_decode($mtch[1]));
$cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
if ($cnt) {
foreach ($matches as $mtch) {
$unescaped = xmlify(file_tag_decode($mtch[1]));
$terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}


+ 15
- 9
include/conversation.php View File

@ -309,8 +309,9 @@ function localize_item(&$item){
$matches = null;
if (preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
foreach ($matches as $mtch) {
if (! strpos($mtch[1],'zrl='))
if (! strpos($mtch[1],'zrl=')) {
$item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']);
}
}
}
@ -1360,20 +1361,25 @@ function conv_sort($arr,$order) {
$arr = $newarr;
foreach ($arr as $x)
if ($x['id'] == $x['parent'])
$parents[] = $x;
foreach ($arr as $x) {
if ($x['id'] == $x['parent']) {
$parents[] = $x;
}
}
if (stristr($order,'created'))
if (stristr($order,'created')) {
usort($parents,'sort_thr_created');
elseif (stristr($order,'commented'))
} elseif (stristr($order,'commented')) {
usort($parents,'sort_thr_commented');
}
if (count($parents))
foreach ($parents as $i=>$_x)
if (count($parents)) {
foreach($parents as $i=>$_x) {
$parents[$i]['children'] = get_item_children($arr, $_x);
}
}
/*foreach ($arr as $x) {
/*foreach($arr as $x) {
if ($x['id'] != $x['parent']) {
$p = find_thread_parent_index($parents,$x);
if ($p !== false)


+ 2
- 2
include/dfrn.php View File

@ -1277,7 +1277,7 @@ class dfrn {
$href = "";
$width = 0;
foreach ($avatar->attributes AS $attributes) {
/// @TODO Rewrite these similar if() to one switch
/// @TODO Rewrite these similar if () to one switch
if ($attributes->name == "href") {
$href = $attributes->textContent;
}
@ -2122,7 +2122,7 @@ class dfrn {
$title = "";
foreach ($links AS $link) {
foreach ($link->attributes AS $attributes) {
/// @TODO Rewrite these repeated (same) if() statements to a switch()
/// @TODO Rewrite these repeated (same) if () statements to a switch()
if ($attributes->name == "href") {
$href = $attributes->textContent;
}


+ 1
- 1
include/ostatus.php View File

@ -1138,7 +1138,7 @@ class ostatus {
continue;
}
/// @TODO One statment is okay (until if() )
/// @TODO One statment is okay (until if () )
$arr = array();
$arr["network"] = $details["network"];
$arr["uri"] = $single_conv->id;


+ 2
- 1
include/security.php View File

@ -358,8 +358,9 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
$gs = '<<>>'; // should be impossible to match
if (is_array($groups) && count($groups)) {
foreach ($groups as $g)
foreach ($groups as $g) {
$gs .= '|<' . intval($g) . '>';
}
}
$sql = sprintf(


+ 2
- 1
include/text.php View File

@ -421,8 +421,9 @@ function expand_acl($s) {
$t = str_replace('<','',$s);
$a = explode('>',$t);
foreach ($a as $aa) {
if (intval($aa))
if (intval($aa)) {
$ret[] = intval($aa);
}
}
}
return $ret;


Loading…
Cancel
Save