summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-08-02 18:13:10 -0400
committerCraig Andrews <candrews@integralblue.com>2009-08-02 18:13:10 -0400
commitc65056aa8d711804c8b365542db3890db425ae5a (patch)
tree66fc66d27c8cbb3e5e32be475d3f0bd61ce39ec4
parentfdaba2e94bf4948c14408c14865e8fc03e33cc43 (diff)
parente670e4306bf3e0e7e90523bcbfa2eb8060f4ed67 (diff)
Merge commit 'jeff-themovie/0.8.x-small-fixes-2' into 0.8.x
-rw-r--r--actions/conversation.php2
-rw-r--r--actions/twitapigroups.php5
-rw-r--r--actions/twitapitags.php5
-rw-r--r--lib/twitterapi.php4
-rw-r--r--lib/util.php11
5 files changed, 14 insertions, 13 deletions
diff --git a/actions/conversation.php b/actions/conversation.php
index c8755ba6e..6b5d8d54d 100644
--- a/actions/conversation.php
+++ b/actions/conversation.php
@@ -167,6 +167,8 @@ class ConversationTree extends NoticeList
function _buildTree()
{
+ $cnt = 0;
+
$this->tree = array();
$this->table = array();
diff --git a/actions/twitapigroups.php b/actions/twitapigroups.php
index f899bc369..82604ebff 100644
--- a/actions/twitapigroups.php
+++ b/actions/twitapigroups.php
@@ -114,8 +114,7 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
$this->show_xml_timeline($notice);
break;
case 'rss':
- $this->show_rss_timeline($notice, $title, $link,
- $subtitle, $suplink);
+ $this->show_rss_timeline($notice, $title, $link, $subtitle);
break;
case 'atom':
if (isset($apidata['api_arg'])) {
@@ -127,7 +126,7 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
'api/laconica/groups/timeline.atom';
}
$this->show_atom_timeline($notice, $title, $id, $link,
- $subtitle, $suplink, $selfuri);
+ $subtitle, null, $selfuri);
break;
case 'json':
$this->show_json_timeline($notice);
diff --git a/actions/twitapitags.php b/actions/twitapitags.php
index 5c8527530..e19e1b1ed 100644
--- a/actions/twitapitags.php
+++ b/actions/twitapitags.php
@@ -88,8 +88,7 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
$this->show_xml_timeline($notice);
break;
case 'rss':
- $this->show_rss_timeline($notice, $title, $link,
- $subtitle, $suplink);
+ $this->show_rss_timeline($notice, $title, $link, $subtitle);
break;
case 'atom':
if (isset($apidata['api_arg'])) {
@@ -101,7 +100,7 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
'api/laconica/tags/timeline.atom';
}
$this->show_atom_timeline($notice, $title, $id, $link,
- $subtitle, $suplink, $selfuri);
+ $subtitle, null, $selfuri);
break;
case 'json':
$this->show_json_timeline($notice);
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index e6af33e82..4115d9dcb 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -479,12 +479,12 @@ class TwitterapiAction extends Action
$this->element('link', null, $entry['link']);
# RSS only supports 1 enclosure per item
- if($entry['enclosures']){
+ if(array_key_exists('enclosures', $entry) and !empty($entry['enclosures'])){
$enclosure = $entry['enclosures'][0];
$this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null);
}
- if($entry['tags']){
+ if(array_key_exists('tags', $entry)){
foreach($entry['tags'] as $tag){
$this->element('category', null,$tag);
}
diff --git a/lib/util.php b/lib/util.php
index d784bb793..c8e318efe 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -140,7 +140,7 @@ function common_have_session()
function common_ensure_session()
{
$c = null;
- if (array_key_exists(session_name, $_COOKIE)) {
+ if (array_key_exists(session_name(), $_COOKIE)) {
$c = $_COOKIE[session_name()];
}
if (!common_have_session()) {
@@ -1410,20 +1410,21 @@ function common_client_ip()
return null;
}
- if ($_SERVER['HTTP_X_FORWARDED_FOR']) {
- if ($_SERVER['HTTP_CLIENT_IP']) {
+ if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
+ if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
$proxy = $_SERVER['HTTP_CLIENT_IP'];
} else {
$proxy = $_SERVER['REMOTE_ADDR'];
}
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
- if ($_SERVER['HTTP_CLIENT_IP']) {
+ $proxy = null;
+ if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
}
- return array($ip, $proxy);
+ return array($proxy, $ip);
}