aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTobias Hößl <tobias@hoessl.eu>2012-02-28 21:56:42 +0000
committerTobias Hößl <tobias@hoessl.eu>2012-02-28 21:56:42 +0000
commit5bb8ed4b8b5310acc8556ef2fba7b3958284b2a6 (patch)
tree6f15b4cff6c76ee7f93b4e50f28142b3eaee5007 /include
parent3d249f0eddb058f74b33d8205202b17ab7555aa6 (diff)
downloadvolse-hubzilla-5bb8ed4b8b5310acc8556ef2fba7b3958284b2a6.tar.gz
volse-hubzilla-5bb8ed4b8b5310acc8556ef2fba7b3958284b2a6.tar.bz2
volse-hubzilla-5bb8ed4b8b5310acc8556ef2fba7b3958284b2a6.zip
Mostly some checks in order to avoid Notices; 1 real bugfix in /mod/network.php
Diffstat (limited to 'include')
-rwxr-xr-xinclude/conversation.php5
-rwxr-xr-xinclude/oembed.php2
-rwxr-xr-xinclude/template_processor.php9
3 files changed, 11 insertions, 5 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 9f564843e..bd9b11bee 100755
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -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'),
diff --git a/include/oembed.php b/include/oembed.php
index 5c3c595f5..52068efc7 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -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": {
diff --git a/include/template_processor.php b/include/template_processor.php
index 28c3f07dd..7a4cba64e 100755
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -92,8 +92,13 @@
*/
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]);