| |

VerySource

 Forgot password?
 Register
Search
VerySource»Forum Development .NET

1

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-6-7 11:00:01
| Show all posts
Text filtering problem
I have seen such as: str.Replace("script","")...
Think this is bad
Wouldn’t it be better if it could keep the content as it was and was not vulnerable to script attacks?
Expert advice~!~1
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-6-8 17:30:01
| Show all posts
Replaced <>
Reply

Use magic Report

1

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-6-8 20:45:01
| Show all posts
I thought about this too!
but
After storing in the database, then what to do when it is read on the page
Reply

Use magic Report

0

Threads

5

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-12 09:00:01
| Show all posts
Use htmlencode and htmldecode to protect against attacks
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-6-12 17:15:01
| Show all posts
"<" ==> "&lt;"
">" ==> "&gt;"
I’m not afraid of the replacement
Reply

Use magic Report

1

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-6-13 09:30:01
| Show all posts
Thanks upstairs

I want to be a text editor
Just like the text box when replying in verysource, you can output the input content in the original format

Normal text box has no line breaks
Reply

Use magic Report

0

Threads

32

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-6-23 10:45:01
| Show all posts
This trouble, you must have a dictionary of html encoding corresponding to special characters.
Refer to the source code of freetextbox.
Reply

Use magic Report

0

Threads

32

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-6-23 18:45:01
| Show all posts
I mean ‘output the input content in the original format’. If it’s just a carriage return or line feed, it’s another matter.
Reply

Use magic Report

1

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-6-24 18:30:01
| Show all posts
solved
Just process the input characters
Thank you all
Reply

Use magic Report

Return to list New
You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list