Merge commit 'jeff-themovie/0.8.x-small-fixes-2' into 0.8.x

This commit is contained in:
Craig Andrews 2009-08-02 18:13:10 -04:00
commit c65056aa8d
5 changed files with 14 additions and 13 deletions

View File

@ -167,6 +167,8 @@ class ConversationTree extends NoticeList
function _buildTree() function _buildTree()
{ {
$cnt = 0;
$this->tree = array(); $this->tree = array();
$this->table = array(); $this->table = array();

View File

@ -114,8 +114,7 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
$this->show_xml_timeline($notice); $this->show_xml_timeline($notice);
break; break;
case 'rss': case 'rss':
$this->show_rss_timeline($notice, $title, $link, $this->show_rss_timeline($notice, $title, $link, $subtitle);
$subtitle, $suplink);
break; break;
case 'atom': case 'atom':
if (isset($apidata['api_arg'])) { if (isset($apidata['api_arg'])) {
@ -127,7 +126,7 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
'api/laconica/groups/timeline.atom'; 'api/laconica/groups/timeline.atom';
} }
$this->show_atom_timeline($notice, $title, $id, $link, $this->show_atom_timeline($notice, $title, $id, $link,
$subtitle, $suplink, $selfuri); $subtitle, null, $selfuri);
break; break;
case 'json': case 'json':
$this->show_json_timeline($notice); $this->show_json_timeline($notice);

View File

@ -88,8 +88,7 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
$this->show_xml_timeline($notice); $this->show_xml_timeline($notice);
break; break;
case 'rss': case 'rss':
$this->show_rss_timeline($notice, $title, $link, $this->show_rss_timeline($notice, $title, $link, $subtitle);
$subtitle, $suplink);
break; break;
case 'atom': case 'atom':
if (isset($apidata['api_arg'])) { if (isset($apidata['api_arg'])) {
@ -101,7 +100,7 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
'api/laconica/tags/timeline.atom'; 'api/laconica/tags/timeline.atom';
} }
$this->show_atom_timeline($notice, $title, $id, $link, $this->show_atom_timeline($notice, $title, $id, $link,
$subtitle, $suplink, $selfuri); $subtitle, null, $selfuri);
break; break;
case 'json': case 'json':
$this->show_json_timeline($notice); $this->show_json_timeline($notice);

View File

@ -479,12 +479,12 @@ class TwitterapiAction extends Action
$this->element('link', null, $entry['link']); $this->element('link', null, $entry['link']);
# RSS only supports 1 enclosure per item # RSS only supports 1 enclosure per item
if($entry['enclosures']){ if(array_key_exists('enclosures', $entry) and !empty($entry['enclosures'])){
$enclosure = $entry['enclosures'][0]; $enclosure = $entry['enclosures'][0];
$this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null); $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){ foreach($entry['tags'] as $tag){
$this->element('category', null,$tag); $this->element('category', null,$tag);
} }

View File

@ -140,7 +140,7 @@ function common_have_session()
function common_ensure_session() function common_ensure_session()
{ {
$c = null; $c = null;
if (array_key_exists(session_name, $_COOKIE)) { if (array_key_exists(session_name(), $_COOKIE)) {
$c = $_COOKIE[session_name()]; $c = $_COOKIE[session_name()];
} }
if (!common_have_session()) { if (!common_have_session()) {
@ -1410,20 +1410,21 @@ function common_client_ip()
return null; return null;
} }
if ($_SERVER['HTTP_X_FORWARDED_FOR']) { if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
if ($_SERVER['HTTP_CLIENT_IP']) { if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
$proxy = $_SERVER['HTTP_CLIENT_IP']; $proxy = $_SERVER['HTTP_CLIENT_IP'];
} else { } else {
$proxy = $_SERVER['REMOTE_ADDR']; $proxy = $_SERVER['REMOTE_ADDR'];
} }
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else { } else {
if ($_SERVER['HTTP_CLIENT_IP']) { $proxy = null;
if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
$ip = $_SERVER['HTTP_CLIENT_IP']; $ip = $_SERVER['HTTP_CLIENT_IP'];
} else { } else {
$ip = $_SERVER['REMOTE_ADDR']; $ip = $_SERVER['REMOTE_ADDR'];
} }
} }
return array($ip, $proxy); return array($proxy, $ip);
} }