X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofiles.php;h=409999a3e86785dbc570847169e066488cd842c0;hb=af12c696cbcd6d38db7421aa3a1c02fbb9f90912;hp=0bb476549eb89d93b624c404740b72aba13cd7b3;hpb=bd512ab60c5128cec449a48e7d0736303f961e89;p=friendica.git diff --git a/mod/profiles.php b/mod/profiles.php index 0bb476549e..409999a3e8 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -68,7 +68,10 @@ function profiles_post(&$a) { if($with != strip_tags($orig[0]['with'])) { $prf = ''; $lookup = $with; - if((strpos($lookup,'@')) || (strpos($lookup,'http://'))) { + if(strpos($lookup,'@') === 0) + $lookup = substr($lookup,1); + $lookup = str_replace('_',' ', $lookup); + if(strpos($lookup,'@') || (strpos($lookup,'http://'))) { $newname = $lookup; $links = @lrdd($lookup); if(count($links)) { @@ -101,6 +104,8 @@ function profiles_post(&$a) { if($prf) { $with = str_replace($lookup,'' . $newname . '', $with); + if(strpos($with,'@') === 0) + $with = substr($with,1); } } else @@ -200,11 +205,9 @@ function profiles_post(&$a) { if($is_default) { // Update global directory in background - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) - proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &", - array(),$foo)); + proc_run('php',"include/directory.php","$url"); } } } @@ -223,7 +226,7 @@ function profiles_content(&$a) { } if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) { - $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 AND `self` = 0 LIMIT 1", + $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1", intval($a->argv[2]), intval(local_user()) ); @@ -240,8 +243,9 @@ function profiles_content(&$a) { intval($a->argv[2]), intval(local_user()) ); - $r = q("DELETE FROM `profile` WHERE `id` = %d LIMIT 1", - intval($a->argv[2]) + $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($a->argv[2]), + intval(local_user()) ); if($r) notice( t('Profile deleted.') . EOL);