summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-02-22 17:03:41 -0800
committerZach Copley <zach@controlyourself.ca>2009-02-22 17:03:41 -0800
commit8e0508dad3bb888b0c01834614b1aa7e16cfe583 (patch)
tree04f2734597377942fbbfc5b4f133e951ccc645a5 /lib
parentcdab8d55a96b61ce6cfbec697d95e3223751fd3f (diff)
parentda532bae9131b6dec8f5c0d67ce77c4ad1736f7d (diff)
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
Diffstat (limited to 'lib')
-rw-r--r--lib/grouplist.php2
-rw-r--r--lib/noticesection.php2
-rw-r--r--lib/omb.php6
-rw-r--r--lib/openid.php3
-rw-r--r--lib/popularnoticesection.php2
-rw-r--r--lib/profilelist.php2
-rw-r--r--lib/router.php10
-rw-r--r--lib/searchaction.php3
-rw-r--r--lib/util.php4
9 files changed, 19 insertions, 15 deletions
diff --git a/lib/grouplist.php b/lib/grouplist.php
index 6801ab426..1b8547499 100644
--- a/lib/grouplist.php
+++ b/lib/grouplist.php
@@ -151,7 +151,7 @@ class GroupList extends Widget
# If we're on a list with an owner (subscriptions or subscribers)...
- if ($user && $user->id == $this->owner->id) {
+ if (!empty($user) && !empty($this->owner) && $user->id == $this->owner->id) {
$this->showOwnerControls();
}
diff --git a/lib/noticesection.php b/lib/noticesection.php
index 97b517529..b31f18744 100644
--- a/lib/noticesection.php
+++ b/lib/noticesection.php
@@ -96,7 +96,7 @@ class NoticeSection extends Section
$this->out->elementStart('p', 'entry-content');
$this->out->raw($notice->rendered);
$this->out->elementEnd('p');
- if ($notice->value) {
+ if (!empty($notice->value)) {
$this->out->elementStart('p');
$this->out->text($notice->value);
$this->out->elementEnd('p');
diff --git a/lib/omb.php b/lib/omb.php
index f2dbef5ba..29e14c75f 100644
--- a/lib/omb.php
+++ b/lib/omb.php
@@ -239,7 +239,7 @@ function omb_broadcast_profile($profile)
while ($sub->fetch()) {
$rp = Remote_profile::staticGet('id', $sub->subscriber);
if ($rp) {
- if (!$updated[$rp->updateprofileurl]) {
+ if (!array_key_exists($rp->updateprofileurl, $updated)) {
if (omb_update_profile($profile, $rp, $sub)) {
$updated[$rp->updateprofileurl] = true;
}
@@ -295,7 +295,9 @@ function omb_update_profile($profile, $remote_profile, $subscription)
common_debug('Got HTTP result "'.print_r($result,true).'"', __FILE__);
- if ($result->status == 403) { # not authorized, don't send again
+ if (empty($result) || $result) {
+ common_debug("Unable to contact " . $req->get_normalized_http_url());
+ } else if ($result->status == 403) { # not authorized, don't send again
common_debug('403 result, deleting subscription', __FILE__);
$subscription->delete();
return false;
diff --git a/lib/openid.php b/lib/openid.php
index 860573702..5c3d460da 100644
--- a/lib/openid.php
+++ b/lib/openid.php
@@ -64,6 +64,9 @@ function oid_set_last($openid_url)
function oid_get_last()
{
+ if (empty($_COOKIE[OPENID_COOKIE_KEY])) {
+ return null;
+ }
$openid_url = $_COOKIE[OPENID_COOKIE_KEY];
if ($openid_url && strlen($openid_url) > 0) {
return $openid_url;
diff --git a/lib/popularnoticesection.php b/lib/popularnoticesection.php
index 5380563b9..c7c7f0215 100644
--- a/lib/popularnoticesection.php
+++ b/lib/popularnoticesection.php
@@ -31,8 +31,6 @@ if (!defined('LACONICA')) {
exit(1);
}
-define('NOTICES_PER_SECTION', 5);
-
/**
* Base class for sections showing lists of notices
*
diff --git a/lib/profilelist.php b/lib/profilelist.php
index 8bef49dce..c2040fbc2 100644
--- a/lib/profilelist.php
+++ b/lib/profilelist.php
@@ -34,8 +34,6 @@ if (!defined('LACONICA')) {
require_once INSTALLDIR.'/lib/widget.php';
-define('PROFILES_PER_PAGE', 20);
-
/**
* Widget to show a list of profiles
*
diff --git a/lib/router.php b/lib/router.php
index 9d0d3a3f0..e842604e9 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -47,7 +47,7 @@ require_once 'Net/URL/Mapper.php';
class Router
{
- static $m = null;
+ var $m = null;
static $inst = null;
static function get()
@@ -98,12 +98,14 @@ class Router
$main = array('login', 'logout', 'register', 'subscribe',
'unsubscribe', 'confirmaddress', 'recoverpassword',
'invite', 'favor', 'disfavor', 'sup',
- 'tagother', 'block');
+ 'block');
foreach ($main as $a) {
$m->connect('main/'.$a, array('action' => $a));
}
+ $m->connect('main/tagother/:id', array('action' => 'tagother'));
+
// these take a code
foreach (array('register', 'confirmaddress', 'recoverpassword') as $c) {
@@ -370,7 +372,7 @@ class Router
return $match;
}
- function build($action, $args=null, $fragment=null)
+ function build($action, $args=null, $params=null, $fragment=null)
{
$action_arg = array('action' => $action);
@@ -380,6 +382,6 @@ class Router
$args = $action_arg;
}
- return $this->m->generate($args, null, $fragment);
+ return $this->m->generate($args, $params, $fragment);
}
} \ No newline at end of file
diff --git a/lib/searchaction.php b/lib/searchaction.php
index fdfb8dc5a..df6876445 100644
--- a/lib/searchaction.php
+++ b/lib/searchaction.php
@@ -79,10 +79,11 @@ class SearchAction extends Action
function showTop($arr=null)
{
+ $error = null;
if ($arr) {
$error = $arr[1];
}
- if ($error) {
+ if (!empty($error)) {
$this->element('p', 'error', $error);
} else {
$instr = $this->getInstructions();
diff --git a/lib/util.php b/lib/util.php
index 46aa7b9df..5345a08bb 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -705,10 +705,10 @@ function common_relative_profile($sender, $nickname, $dt=null)
return null;
}
-function common_local_url($action, $args=null, $fragment=null)
+function common_local_url($action, $args=null, $params=null, $fragment=null)
{
$r = Router::get();
- $path = $r->build($action, $args, $fragment);
+ $path = $r->build($action, $args, $params, $fragment);
if ($path) {
}
if (common_config('site','fancy')) {