aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-01 23:48:27 -0800
committerfriendica <info@friendica.com>2015-01-01 23:48:27 -0800
commit8b844ed978d9d6b769e2c055b1e1ec042e51e152 (patch)
tree4bcd4fdc22ebe0370bf41655b37f7b98b85d1c33 /mod
parent82d0a4af452015e870bdcea56f1008ea22d066b3 (diff)
parentc7aa8bf1b4c2a7ca4d7bf1552aabcb0c0a54756e (diff)
downloadvolse-hubzilla-8b844ed978d9d6b769e2c055b1e1ec042e51e152.tar.gz
volse-hubzilla-8b844ed978d9d6b769e2c055b1e1ec042e51e152.tar.bz2
volse-hubzilla-8b844ed978d9d6b769e2c055b1e1ec042e51e152.zip
Merge branch 'master' into trinidad
Diffstat (limited to 'mod')
-rw-r--r--mod/profiles.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/mod/profiles.php b/mod/profiles.php
index 6bdc7f11a..fa6a6e35c 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -11,7 +11,7 @@ function profiles_init(&$a) {
if((argc() > 2) && (argv(1) === "drop") && intval(argv(2))) {
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is_default` = 0 LIMIT 1",
- intval($a->argv[2]),
+ intval(argv(2)),
intval(local_user())
);
if(! count($r)) {
@@ -159,9 +159,13 @@ function profiles_init(&$a) {
if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_user(),'multi_profiles')) {
if(feature_enabled(local_user(),'multi_profiles'))
$id = $a->argv[1];
- else
- $id = q("select id from profile where uid = %d and is_default = 1",local_user())[0]['id'];
-
+ else {
+ $x = q("select id from profile where uid = %d and is_default = 1",
+ intval(local_user())
+ );
+ if($x)
+ $id = $x[0]['id'];
+ }
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($id),
intval(local_user())
@@ -564,9 +568,13 @@ function profiles_content(&$a) {
if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_user(),'multi_profiles')) {
if(feature_enabled(local_user(),'multi_profiles'))
$id = $a->argv[1];
- else
- $id = q("select id from profile where uid = %d and is_default = 1",local_user())[0]['id'];
-
+ else {
+ $x = q("select id from profile where uid = %d and is_default = 1",
+ intval(local_user())
+ );
+ if($x)
+ $id = $x[0]['id'];
+ }
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($id),
intval(local_user())