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 917671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:14:51+00:00 2026-05-15T18:14:51+00:00

HI guys, I building an app using CodeIgniter and I came to a problem.

  • 0

HI guys,

I building an app using CodeIgniter and I came to a problem. I have a form with a textarea in which the user puts his text using a simple editor powered by jwysiwyg.jquery. The problem is that is need to clean this input of garbage code (link the one that comes with pasting directly from Word).

The form is validated with the form_validation library from CodeIgniter, with this rule:

array(
 'field' => 'job[description]',
 'label' => 'Description',
 'rules' => 'trim|required|callback_clean_html'
),

Then I have a clean_html method that simply does a:

return strip_tags($text,'<a><p><br><strong><em><h3><h4><h5><ul><ol><li>');

The problem is that this is simply ignored and the original text gets inserted in the database. The method runs (I’ve tested). I asume it’s because a callback should return TRUE or FALSE, but then xss_clean doesn’t return a BOOL. The documentation isn’t much help.

Any thoughs?

Thanks in advance.

  • 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-05-15T18:14:52+00:00Added an answer on May 15, 2026 at 6:14 pm

    I think form_validation callbacks do need to return a bool. I find that form_validation is most useful when you need to display an error message to a user usually to resubmit the form. Although the prepping functions can be convenient, they don’t need to be there to validate. Why not pass the submitted string through the strip_tags function after the form is submitted but before you send it to your db?

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

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First google hit would probably help you. May 16, 2026 at 5:38 pm
  • Editorial Team
    Editorial Team added an answer Ok... so it is a complete hack/workaround, but I have… May 16, 2026 at 5:38 pm
  • Editorial Team
    Editorial Team added an answer Chrome in mozilla refers to several things, but the underlying… May 16, 2026 at 5:38 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a web app I'm building that has about 50 forms. I have
Hey guys I'm using the latest version of XCode (3.2.2) and I've linked the
I am trying to coach some guys on building web applications. They understand and
I am building a basic POS app for my cousin's pharmacy store so that
I am building my own web app, and there are open source code out
Guys, would you describe a few things about c++ building blocks, on unix. I
Hi guys I'm building a facility to be able to generate a csv file
guys. I am trying to build a voip app for android. I want to
Guys, I need some help! I have a fully rendered menu (a safe html
guys. Say I have the following table: ID | String ---+--------- 1 | <123><345>

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.