aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/profiles.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/mod/profiles.php b/mod/profiles.php
index 3ae1390df..fe45f1b92 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -272,9 +272,17 @@ function profiles_post(&$a) {
$name = escape_tags(trim($_POST['name']));
- if($orig[0]['name'] != $name)
+ if($orig[0]['name'] != $name) {
$namechanged = true;
+ $v = validate_channelname($name);
+ if($v) {
+ $notice($v);
+ $namechanged = false;
+ $name = $orig[0]['name'];
+ }
+ }
+
$pdesc = escape_tags(trim($_POST['pdesc']));
$gender = escape_tags(trim($_POST['gender']));
$address = escape_tags(trim($_POST['address']));
@@ -563,6 +571,10 @@ function profiles_post(&$a) {
dbesc(datetime_convert()),
dbesc($channel['xchan_hash'])
);
+ $r = q("UPDATE channel SET channel_name = '%s' WHERE channel_hash = '%s'",
+ dbesc($name),
+ dbesc($channel['xchan_hash'])
+ );
}
if($is_default) {