]> git.mxchange.org Git - friendica.git/commitdiff
Mostly some checks in order to avoid Notices; 1 real bugfix in /mod/network.php
authorTobias Hößl <tobias@hoessl.eu>
Tue, 28 Feb 2012 21:56:42 +0000 (21:56 +0000)
committerTobias Hößl <tobias@hoessl.eu>
Tue, 28 Feb 2012 21:56:42 +0000 (21:56 +0000)
include/conversation.php
include/oembed.php
include/template_processor.php
mod/network.php

index 9f564843e91c77d2827fccf883011443f2c20616..bd9b11bee6b141aef57ec20cd5af00dca7faefbe 100755 (executable)
@@ -373,7 +373,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                                $comments[$item['parent']] = 1;
                                        else
                                                $comments[$item['parent']] += 1;
-                               }
+                               } elseif(! x($comments,$item['parent'])) 
+                                       $comments[$item['parent']] = 0; // avoid notices later on
                        }
 
                        // map all the like/dislike activities for each parent item 
@@ -921,7 +922,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
        $o .= replace_macros($tpl,array(
                '$return_path' => $a->cmd,
                '$action' =>  $a->get_baseurl().'/item',
-               '$share' => (($x['button']) ? $x['button'] : t('Share')),
+               '$share' => (x($x,'button') ? $x['button'] : t('Share')),
                '$upload' => t('Upload photo'),
                '$shortupload' => t('upload photo'),
                '$attach' => t('Attach file'),
index 5c3c595f57e910ba47577746e7afd53d89c8b1e0..52068efc763fab6599e4d98b2168452c4815f9c6 100755 (executable)
@@ -62,7 +62,7 @@ function oembed_fetch_url($embedurl){
        
 function oembed_format_object($j){
        $embedurl = $j->embedurl;
-       $jhtml = oembed_iframe($j->embedurl,$j->width,$j->height );
+       $jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) );
        $ret="<span class='oembed ".$j->type."'>";
        switch ($j->type) {
                case "video": {
index 28c3f07ddd1e46dfc477deb4f0fc9b7a1479d6c4..7a4cba64e93b4e5aab9f5d817d315cb4e410faed 100755 (executable)
                 */
                private function _replcb_for($args){
                        $m = array_map('trim', explode(" as ", $args[2]));
-                       list($keyname, $varname) = explode("=>",$m[1]);
-                       if (is_null($varname)) { $varname=$keyname; $keyname=""; }
+                       $x = explode("=>",$m[1]);
+                       if (count($x) == 1) {
+                               $varname = $x[0];
+                               $keyname = "";
+                       } else {
+                               list($keyname, $varname) = $x;
+                       }
                        if ($m[0]=="" || $varname=="" || is_null($varname)) die("template error: 'for ".$m[0]." as ".$varname."'") ;
                        //$vals = $this->r[$m[0]];
                        $vals = $this->_get_var($m[0]);
index 03a671b6157d51dc7939dfbfa024eb6ca9bf7fe2..26265f5a0f34c9eb56ff44fed9c6dcf4af9e9e8c 100755 (executable)
@@ -44,7 +44,7 @@ function network_init(&$a) {
        }
        
        $a->page['aside'] .= group_side('network','network',true,$group_id);
-       $a->page['aside'] .= networks_widget($a->get_baseurl() . '/network',(($_GET['nets']) ? $_GET['nets'] : ''));
+       $a->page['aside'] .= networks_widget($a->get_baseurl() . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
        $a->page['aside'] .= saved_searches($search);
 
 }
@@ -130,15 +130,15 @@ function network_content(&$a, $update = 0) {
                $starred_active = 'active';
        }
        
-       if($_GET['bmark']) {
+       if(x($_GET,'bmark')) {
                $bookmarked_active = 'active';
        }
 
-       if($_GET['conv']) {
+       if(x($_GET,'conv')) {
                $conv_active = 'active';
        }
 
-       if($_GET['spam']) {
+       if(x($_GET,'spam')) {
                $spam_active = 'active';
        }
 
@@ -245,7 +245,7 @@ function network_content(&$a, $update = 0) {
                $def_acl = array('allow_cid' => '<' . intval($cid) . '>');
 
        if(! $update) {
-               if(group) {
+               if($group) {
                        if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {
                                notice( sprintf( tt('Warning: This group contains %s member from an insecure network.',
                                                                        'Warning: This group contains %s members from an insecure network.',
@@ -492,7 +492,9 @@ function network_content(&$a, $update = 0) {
 
                        $items = conv_sort($items,$ordering);
 
-               }       
+               } else {
+                       $items = array();
+               }
        }