- if(! x($_FILES,'media')) {
- $nick = $a->argv[1];
- $r = q("SELECT `user`.*, `contact`.`id` FROM `user` INNER JOIN `contact` on `user`.`uid` = `contact`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
- dbesc($nick)
- );
-
- if(! count($r))
- return;
- }
- else {
+ if(! x($_FILES,'media')) {
+ $nick = $a->argv[1];
+ $r = q("SELECT `user`.*, `contact`.`id` FROM `user` INNER JOIN `contact` on `user`.`uid` = `contact`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
+ dbesc($nick)
+ );
+
+ if(! count($r)){
+ if ($r_json) { echo json_encode(['error'=>t('Invalid request.')]); killme(); }
+ return;
+ }
+ } else {