diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 8 | ||||
-rw-r--r-- | lib/router.php | 6 | ||||
-rw-r--r-- | lib/twitter.php | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/lib/action.php b/lib/action.php index cc98d4445..f2027e0f1 100644 --- a/lib/action.php +++ b/lib/action.php @@ -845,10 +845,12 @@ class Action extends HTMLOutputter // lawsuit } if ($lm) { header('Last-Modified: ' . date(DATE_RFC1123, $lm)); - if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { - $ims = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']); + if (array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) { + $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE']; + $ims = strtotime($if_modified_since); if ($lm <= $ims) { - $if_none_match = $_SERVER['HTTP_IF_NONE_MATCH']; + $if_none_match = (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER)) ? + $_SERVER['HTTP_IF_NONE_MATCH'] : null; if (!$if_none_match || !$etag || $this->_hasEtag($etag, $if_none_match)) { diff --git a/lib/router.php b/lib/router.php index 6fb2f9487..060253eb5 100644 --- a/lib/router.php +++ b/lib/router.php @@ -165,6 +165,12 @@ class Router array('action' => 'deletenotice'), array('notice' => '[0-9]+')); + // conversation + + $m->connect('conversation/:id', + array('action' => 'conversation'), + array('id' => '[0-9]+')); + $m->connect('message/new', array('action' => 'newmessage')); $m->connect('message/new?to=:to', array('action' => 'newmessage'), array('to' => '[A-Za-z0-9_-]+')); $m->connect('message/:message', diff --git a/lib/twitter.php b/lib/twitter.php index ccc6c93ca..c1d0dc254 100644 --- a/lib/twitter.php +++ b/lib/twitter.php @@ -346,7 +346,7 @@ function save_twitter_friends($user, $twitter_id, $screen_name, $password) function is_twitter_bound($notice, $flink) { // Check to see if notice should go to Twitter - if ($flink->noticesync & FOREIGN_NOTICE_SEND) { + if (!empty($flink) && ($flink->noticesync & FOREIGN_NOTICE_SEND)) { // If it's not a Twitter-style reply, or if the user WANTS to send replies. if (!preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content) || |