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

  • SEARCH
  • Home
  • 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 8356469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:12:29+00:00 2026-06-09T10:12:29+00:00

I have a Zend project and after time researching I’ve come across this idea.

  • 0

I have a Zend project and after time researching I’ve come across this idea. Of course this is security related and the purpose is to avoid xss attacks.

Other solutions would be to escape them just before showing them, but that would include a lot of special cases, and some time because Zend does not have anything like that implemented.

These are the solutions for escaping before echo-ing them in the phtml
http://codeutopia.net/blog/2007/11/10/how-to-automatically-escape-template-variables-in-zend_view/
and https://github.com/chikaram/gnix-view

Those are a bit too old, maybe someone has already met this problem and has come with better solutions with newer features that Zend has to offer that I haven’t found about.

So, would it be a good practice to escape values before adding them to db and making an exclusion array for rare special cases when I do want javascript code in my values?

If you have better solutions, links and examples would be much appreciated.

  • 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-09T10:12:30+00:00Added an answer on June 9, 2026 at 10:12 am

    No, it would not be, because database is for storing data, not “data already escaped for presentation on specific medium”.

    Consider eg. that you will need in the future to export it to PDF, not show it in HTML. By using your approach, this will be very hard, because the data in the database would already be broken.

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

Sidebar

Related Questions

I typed this: http://localhost/dev.gamenomad.com/Index and I have got this controller in my zend project:
I have included Zend in my project and this library has about 2.8k files.
I have a Zend Framework project using version 1.10.8 with Doctrine 1.2.4.I use Zend_Auth
Zend Project with multiple modules and every modules have its own routes.ini defined inside
I have project written in Zend Framework and it works fine most of environments.
I have a project in PHPStorm, which contains a few libraries (Zend, Doctrine, ...)
Started Googling today to research implementing Zend_Translate in a Zend 1.6.x project i have
I have 2 applications. App1 is some old selfmade php project, not using Zend.
have such zend query: $select = $this->_table ->select() ->where('title LIKE ?', '%'.$searchWord.'%') ->where('description LIKE
I have a project that uses Zend Framework and Zend_Translate . I had to

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.