]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'master' of git://github.com/friendica/friendica
authorTobias Hößl <tobias@hoessl.eu>
Sun, 11 Mar 2012 14:43:16 +0000 (14:43 +0000)
committerTobias Hößl <tobias@hoessl.eu>
Sun, 11 Mar 2012 14:43:16 +0000 (14:43 +0000)
boot.php
include/conversation.php
include/event.php
include/items.php
include/oembed.php
include/template_processor.php
mod/dfrn_request.php
mod/message.php
mod/network.php
mod/parse_url.php

index 1414adb06980a61da1a7ab029343584a3055e38c..561290ef2ea68bad074cbd11a50f1e46d5c15167 100755 (executable)
--- a/boot.php
+++ b/boot.php
@@ -1209,7 +1209,7 @@ function current_theme(){
        $a = get_app();
        
        $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
-       $theme_name = ((is_array($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
+       $theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
        
        if($theme_name && file_exists('view/theme/' . $theme_name . '/style.css'))
                return($theme_name);
@@ -1335,7 +1335,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
                array(
                        'label' => t('Profile'),
                        'url'   => $url.'/?tab=profile',
-                       'sel'   => (($tab=='profile')?'active':''),
+                       'sel'   => ((isset($tab) && $tab=='profile')?'active':''),
                ),
                array(
                        'label' => t('Photos'),
index 526c6ea0052c5dc5c7fdbf4fe3bf51e2b2e05e53..4b2ca316bae8867d6190165339735fb6e1a32ff4 100755 (executable)
@@ -375,7 +375,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 
@@ -915,7 +916,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'),
@@ -980,8 +981,8 @@ function conv_sort($arr,$order) {
                usort($parents,'sort_thr_commented');
 
        if(count($parents))
-               foreach($parents as $x) 
-                       $x['children'] = array();
+               foreach($parents as $i=>$_x) 
+                       $parents[$i]['children'] = array();
 
        foreach($arr as $x) {
                if($x['id'] != $x['parent']) {
index 4a9a9a0041e40ec6318070806ec9add4be990333..29202baddf982417cdf3decedc3f0b69be539dc8 100755 (executable)
@@ -163,7 +163,7 @@ function bbtoevent($s) {
        if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match))
                $ev['adjust'] = $match[1];
        $match = '';
-       $ev['nofinish'] = (($ev['start'] && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0);
+       $ev['nofinish'] = (((x($ev, 'start') && $ev['start']) && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0);
        return $ev;
 
 }
index 1a7aa6c4608d0dd57592ef97782c501750f2ae37..70c72ae165315f7975df384bf8805b308600d224 100755 (executable)
@@ -682,7 +682,7 @@ function item_store($arr,$force_parent = false) {
                unset($arr['dsprsig']);
        }
 
-       if($arr['gravity'])
+       if(x($arr, 'gravity'))
                $arr['gravity'] = intval($arr['gravity']);
        elseif($arr['parent-uri'] === $arr['uri'])
                $arr['gravity'] = 0;
@@ -742,6 +742,7 @@ function item_store($arr,$force_parent = false) {
 
        if($arr['parent-uri'] === $arr['uri']) {
                $parent_id = 0;
+               $parent_deleted = 0;
                $allow_cid = $arr['allow_cid'];
                $allow_gid = $arr['allow_gid'];
                $deny_cid  = $arr['deny_cid'];
@@ -800,6 +801,8 @@ function item_store($arr,$force_parent = false) {
                                logger('item_store: item parent was not found - ignoring item');
                                return 0;
                        }
+                       
+                       $parent_deleted = 0;
                }
        }
 
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 8671587fc4b48d57d60934cfd350c89aef2f00aa..7f7b0b55bd727c16524d03ebef5ed045f5a7a691 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 bc159137df697046fa14abb9ee8bc18b59f4a5e0..452fec1669fe1880d1a1df44e39511c9ba3a4573 100755 (executable)
@@ -43,7 +43,7 @@ function dfrn_request_post(&$a) {
                return;
 
 
-       if($_POST['cancel']) {
+       if(x($_POST, 'cancel')) {
                goaway(z_root());
        } 
 
index 57d45ee3c7933113a45cb3f4401f766a44ed1f29..37f92e8d9d3c903f4986f2163af8c13422e5e4f3 100755 (executable)
@@ -192,7 +192,7 @@ function message_content(&$a) {
                        $a->set_pager_total($r[0]['total']);
        
                $r = q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`, 
-                       `mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` 
+                       `mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` , `contact`.`network`  
                        FROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` 
                        WHERE `mail`.`uid` = %d AND `from-url` $eq '%s' GROUP BY `parent-uri` ORDER BY `created` DESC  LIMIT %d , %d ",
                        intval(local_user()),
index b04a7b489013153999a8a9d47c21d7458580e8c3..aabd9095fc272b4f561060df2a7df5b8fafc75c2 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.',
@@ -491,7 +491,9 @@ function network_content(&$a, $update = 0) {
 
                        $items = conv_sort($items,$ordering);
 
-               }       
+               } else {
+                       $items = array();
+               }
        }
 
 
index e0b378f685448a2ac95142bf25649e733e267319..27dac4d5d318565483a392f3a0a7170e2dae4868 100755 (executable)
@@ -188,7 +188,7 @@ function parse_url_content(&$a) {
 
        if(! $text) {
                logger('parsing meta');
-               $items = $domhead->getElementsByTagName('meta');
+               $items = (isset($domhead) && is_object($domhead) ? $domhead->getElementsByTagName('meta') : null);
                if($items) {
                        foreach($items as $item) {
                                $property = $item->getAttribute('property');