notags calls

implement removeTags function
This commit is contained in:
Adam Magness
2018-11-08 10:14:37 -05:00
parent 991f259ecb
commit a0f65ca7a1
51 changed files with 274 additions and 232 deletions
+21 -20
View File
@@ -22,6 +22,7 @@ use Friendica\Model\Profile;
use Friendica\Module\Login;
use Friendica\Network\Probe;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
function profiles_init(App $a) {
@@ -201,7 +202,7 @@ function profiles_post(App $a) {
$is_default = (($orig[0]['is-default']) ? 1 : 0);
$profile_name = notags(trim($_POST['profile_name']));
$profile_name = Strings::removeTags(trim($_POST['profile_name']));
if (! strlen($profile_name)) {
notice(L10n::t('Profile Name is required.') . EOL);
return;
@@ -228,7 +229,7 @@ function profiles_post(App $a) {
}
}
$name = notags(trim($_POST['name']));
$name = Strings::removeTags(trim($_POST['name']));
if (! strlen($name)) {
$name = '[No Name]';
@@ -238,19 +239,19 @@ function profiles_post(App $a) {
$namechanged = true;
}
$pdesc = notags(trim($_POST['pdesc']));
$gender = notags(trim($_POST['gender']));
$address = notags(trim($_POST['address']));
$locality = notags(trim($_POST['locality']));
$region = notags(trim($_POST['region']));
$postal_code = notags(trim($_POST['postal_code']));
$country_name = notags(trim($_POST['country_name']));
$pub_keywords = profile_clean_keywords(notags(trim($_POST['pub_keywords'])));
$prv_keywords = profile_clean_keywords(notags(trim($_POST['prv_keywords'])));
$marital = notags(trim($_POST['marital']));
$howlong = notags(trim($_POST['howlong']));
$pdesc = Strings::removeTags(trim($_POST['pdesc']));
$gender = Strings::removeTags(trim($_POST['gender']));
$address = Strings::removeTags(trim($_POST['address']));
$locality = Strings::removeTags(trim($_POST['locality']));
$region = Strings::removeTags(trim($_POST['region']));
$postal_code = Strings::removeTags(trim($_POST['postal_code']));
$country_name = Strings::removeTags(trim($_POST['country_name']));
$pub_keywords = profile_clean_keywords(Strings::removeTags(trim($_POST['pub_keywords'])));
$prv_keywords = profile_clean_keywords(Strings::removeTags(trim($_POST['prv_keywords'])));
$marital = Strings::removeTags(trim($_POST['marital']));
$howlong = Strings::removeTags(trim($_POST['howlong']));
$with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
$with = ((x($_POST,'with')) ? Strings::removeTags(trim($_POST['with'])) : '');
if (! strlen($howlong)) {
$howlong = DBA::NULL_DATETIME;
@@ -311,16 +312,16 @@ function profiles_post(App $a) {
}
/// @TODO Not flexible enough for later expansion, let's have more OOP here
$sexual = notags(trim($_POST['sexual']));
$xmpp = notags(trim($_POST['xmpp']));
$homepage = notags(trim($_POST['homepage']));
$sexual = Strings::removeTags(trim($_POST['sexual']));
$xmpp = Strings::removeTags(trim($_POST['xmpp']));
$homepage = Strings::removeTags(trim($_POST['homepage']));
if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) {
// neither http nor https in URL, add them
$homepage = 'http://'.$homepage;
}
$hometown = notags(trim($_POST['hometown']));
$politic = notags(trim($_POST['politic']));
$religion = notags(trim($_POST['religion']));
$hometown = Strings::removeTags(trim($_POST['hometown']));
$politic = Strings::removeTags(trim($_POST['politic']));
$religion = Strings::removeTags(trim($_POST['religion']));
$likes = escape_tags(trim($_POST['likes']));
$dislikes = escape_tags(trim($_POST['dislikes']));