aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php3
-rw-r--r--mod/photos.php3
2 files changed, 4 insertions, 2 deletions
diff --git a/mod/item.php b/mod/item.php
index b6ea8ff08..6ecca8f4a 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -404,7 +404,8 @@ function item_post(&$a) {
);
}
else {
- $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
+ dbesc($name),
dbesc($name),
intval($profile_uid)
);
diff --git a/mod/photos.php b/mod/photos.php
index cb13b7603..b74ca85d7 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -414,7 +414,8 @@ function photos_post(&$a) {
);
}
else {
- $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
+ dbesc($name),
dbesc($name),
intval($page_owner_uid)
);