From 848c0389704ab14aeecc77a5b8bd5d9e7ec4ad06 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 7 Mar 2016 16:54:58 -0800 Subject: issue #313 --- mod/profiles.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'mod/profiles.php') 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) { -- cgit v1.2.3