Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8744757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:53:37+00:00 2026-06-13T11:53:37+00:00

In the good old days when I was a web developer (using PHP), I

  • 0

In the good old days when I was a web developer (using PHP), I used to run all submitted form data through a regex before commencing any processing. For most cases, I would allow alphanumerics along with a small set of punctuation characters which would satisfy 99% of people 99% of the time whilst providing a defense against SQL injection and cross site scripting (yes I used PDO prepared statements as well).

More recently I’ve had to deal with input in an internationalised context, specifically, where the input can be in quite a few different western and eastern European languages as well as Arabic. In these cases, I resorted to removing potentially dangerous characters and letting everything else in. The application had a very small number of users (less than 10) and was only deployed on their internal network so I wasn’t overly concerned about the security of the system but I wouldn’t be comfortable taking this approach on a publicly accessible website.

In summary, I would like the input to be filtered so that what is left, is “plain text” but I’m not sure how to define the concept of plain text in an internationalised context. Are there any PHP libraries that address this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:53:38+00:00Added an answer on June 13, 2026 at 11:53 am

    Everything is “plain text”. Even “‘ DROP TABLE users –” is plain text. Even “<script>” is just plain text.

    What you’re worried about are “special characters”, i.e. plain text which has special meanings in certain contexts. For that, you need to escape theses special characters to “defuse” them in the given context. For HTML, escape them to HTML entities. For SQL, SQL-escape the string (or use prepared statements to avoid this problem in general). For CSV, CSV-escape the values… You get the idea. There are always functions or libraries available which will do this for you, don’t try to reinvent the wheel here.

    If you want to sanitize, i.e. remove content, you need to define better what you want to remove. Removing content also always runs the risk of removing legitimate content your users may want to use. So it’s usually the annoying option.

    For more on this topic, see The Great Escapism (Or: What You Need To Know To Work With Text Within Text).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a C# developer and I'm used to the good old Environment.CurrentUser . Now
I was just thinking back to the good old days when I used to
I am using old good RichEdit control with last version of VB.NET I want
In the good old days of C, I could cast a float to an
In the good old JDBC days I wrote a lot of SQL code that
Back in the good old days of 68k, both pre/post pointer increments/decrements were more
I want what in the good old days would be a two-column table layout.
So... In the good old days of making games, when you were drawing sprites
In the good old days of regular OpenGL, it was fairly easy to determine
I remember using values array on good old mx:HSlider, is there any workaround for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.