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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:24:35+00:00 2026-06-08T05:24:35+00:00

I am writing a Blog module, and sanitize the blog_post at INPUT with $this->form_validation->set_rules(‘blog_data’,

  • 0

I am writing a Blog module, and sanitize the blog_post at INPUT with

$this->form_validation->set_rules('blog_data', 'Blog Post', 'trim|required|min_length[5]|xss_clean'); 

Now that the input has been sanitized I have lost the HTML styling, Can anyone recommend a way to get the styling back to show the blog post in the original styling as posted by the user?

If sanitizing the HTML data at OUTPUT (instead of INPUT) is a good practice then how do people retain the original styling?

For example, wordpress is storing HTML data of user blogs in original form with all styling tags intact (raw HTML). But it must be sanitizing it during output. Then how does it retain the original styling?

How to do it in codeigniter? Please help I have been banging my head for 3 days now .:/

Followup- @Damien Pirsy –

Original code obtained from sql-db:

<img src="http://localhost/lok/images/63a9f0ea7bb98050796b649e85481845/11342974127.jpg" style="cursor: default; height: 208px; float: left; margin: 0px 10px 10px 0px; ">

Output Obtained on web-browser:

<img src="http://localhost/lok/images/63a9f0ea7bb98050796b649e85481845/11342974127.jpg"  default; height: 208px; float: left; margin: 0px 10px 10px 0px; ">
  • 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-08T05:24:36+00:00Added an answer on June 8, 2026 at 5:24 am

    Using “htmlpurifier” with CodeIgniter. The img src styling is unaffected now.

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

Sidebar

Related Questions

I'm now writing my first jQuery Plugin and i found this blog post about
I'm writing a small blog module. I want the users to be able to
I've followed this tutorial: http://anandhansubbiah.com/blog/writing-your-first-android-application/ , but no matter what I do, and what
I'm writing user client for blog system. This is how I perform request var
I'm writing a blog editor using pyqt4. My issue is this. There is a
I am following the tutorial here: http://skywalkersoftwaredevelopment.net/blog/writing-an-orchard-webshop-module-from-scratch-part-1 But I'm having trouble with Part 4:
I'm writing a blog post that uses multiple videos from YouTube and Yahoo Video,
After reading this blog , I want to try writing a similar program myself.
I'm writing a blog archive converter in ruby. In order to convert wordpress post
I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ I have this one function where

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.