News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Words are not censored in Custom Titles [SMF 2.0.5]

Started by porplemontage, September 09, 2013, 06:51:02 PM

Previous topic - Next topic

porplemontage

The word censor is not applied to a user's Custom Title. Does anyone know the code changes to apply the censor to Custom Titles? Thanks!

porplemontage

Figured it out! In Sources/Load.php:

AFTER line 1103:
   censorText($profile['location']);

ADD:
   censorText($profile['usertitle']);

Acans

Hi porplemontage, thanks for the report and the fix for it!

If you like, you can submit your fix to our GitHub Repo so it's fixed in future versions of SMF here: https://github.com/SimpleMachines/SMF2.1

Same goes for any other bugs or improvements you may have. If not, I'll submit your fix to GitHub in the next few days for you.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

GL700Wing

Looks like website title and URL are also not being censored.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

emanuele

And not only that, there are tons of places where censor is not applied (advanced profile fields for example).
I'm not really sure if they are all bugs or not...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Burke ♞ Knight

Quote from: emanuele on September 16, 2013, 07:33:46 AMI'm not really sure if they are all bugs or not...

More likely overlooked, due to not many issues with needing those areas censored.

emanuele

Sorry, what I meant was that I'm not sure it is worth to censor everything, everywhere.
Otherwise, for consistency, I would censor board and category names too.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Burke ♞ Knight

Censor is for keeping members from using the censored words, not the admin.
Using censor on Board & Cat names would not be needed.

Though, profile fields, personal text, and anything else that a regular member can add text to, would be.

GL700Wing

Quote from: emanuele on September 16, 2013, 07:43:33 AM
Sorry, what I meant was that I'm not sure it is worth to censor everything, everywhere.
The information text displayed above the censored words list states "You can enter any words below that you wish to be censored whenever used by a member." (I added the emphasis)

I know it's under the 'Posts and Topics' area but given that word censorship is already applied to a member's signature, personal text and location I figure it it should be applied to all profile text.


Quote from: emanuele on September 16, 2013, 07:43:33 AM
Otherwise, for consistency, I would censor board and category names too.
Given the limited number of people who can normally create boards and/or categories on most forums I don't see this as an issue - I certainly wouldn't be censoring words in a post/profile that I used in board and/or category names.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Arantor

There's actually a reason why it's like that.

Custom titles are, by default, not open to all members. Only admins and maybe global moderators can normally change their custom title by default (so the permissions table says, anyway), and normally it's used for admins to give out custom titles, rather than members being able to set their own as a result.

Since admins are doing so, the odds are that admins won't do anything that can be censored...

Acans

QuoteCustom titles are, by default, not open to all members. Only admins and maybe global moderators can normally change their custom title by default (so the permissions table says, anyway), and normally it's used for admins to give out custom titles, rather than members being able to set their own as a result.

Aye, however their will be the occasional forum that will allow members to set their own custom titles.

I guess the question is do we add it to the censored list for those that would enable it, or leave it out and have a page on the wiki explaining why and how to add to the censored list if they enable their members to choose their own custom title.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

GL700Wing

Quote from: ѕησω on September 21, 2013, 04:16:46 AM
Aye, however their will be the occasional forum that will allow members to set their own custom titles.

I guess the question is do we add it to the censored list for those that would enable it, or leave it out and have a page on the wiki explaining why and how to add to the censored list if they enable their members to choose their own custom title.
As a forum owner my perspective is that words should be able to be censored whenever they are used by anyone - I can't really see why I would want words censored in some places, or for some membergroups, and not others.

However, if word censorship is not going to be applied globally then providing information on how to censor profile fields that are not currently censored (eg, custom title, website title/URL and custom profile fields) would be great.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Arantor

Custom title and specifically website title are possible candidates for censorship, but the others are actually problematic to censor.

See, in both cases you're handling content that can and will be injected into URLs, and if you censor a word you may well find you end up causing something unexpected to happen.

I'm really not sure there is a good way to make it work as you expect it to.

Kindred

I disagree, GL700Wing ...   I think the the censor should apply to fields which can be filled in by the users/public but need not be applied to any admin-only field (like board names and descriptions, or group names, etc)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: