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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:45:31+00:00 2026-06-15T16:45:31+00:00

Today I installed Composer and installed HTMLPurifier , which replaced my old zipped download.

  • 0

Today I installed Composer and installed HTMLPurifier, which replaced my old zipped download. This moved my version from 4.2 to 4.4

This code now no longer works:

$config = HTMLPurifier_Config::createDefault();
$config->set('HTML.Allowed', 'a[href|title],em,strong,b,i,s,p'); 
$config->set('AutoFormat.Linkify', true); 
$purifier = new HTMLPurifier($config);

$do = is_null($comment) ? $this->comment : $comment;
$clean = $purifier->purify($do);

debug($clean);

If I remove the composer autoload, and reference back to the old library, it works. This is on a string that includes http://www.google.com in it. But $clean is identical to $do

edit
Apparently, downloading through composer, the HTMLPURIFIER_PREFIX constant wasn’t being created, and it wasn’t loading the *.ser file (even though it existed. This is defined in library/HTMLPurifier/Bootstrap.php, but that file isn’t included anywhere (therefore not defining, therefore not working).

edit2 Looks like in my case it doesn’t play nice with Composer. It didn’t include the Bootstrap.php file at all. Had to manually call HTMLPurifier_Bootstrap::registerAutoload(); from my app, and it’s working better. Nice work me. More info here

  • 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-15T16:45:33+00:00Added an answer on June 15, 2026 at 4:45 pm

    Turns out, as I said above, that the problem is related to Composer <-> HTMLPurifier interacting, and not properly loading the Bootstrap.php file correctly. Manually calling HTMLPurifier_Bootstrap::registerAutoload(); seems to have fixed it for now.

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

Sidebar

Related Questions

I've installed Domino Server on my local machine today, which is working flawlessly by
I installed today from Market, the Yahoo Mail application and I was reading it
I started learning vim today and installed it using sudo apt-get install vim Now,
Ok this is something weird. I got authlogic-oid installed in my rails app today.
I'm having an extremely difficult day today. I've installed the latest version on Titanium
Today I installed the PHP Development Tools package, but I see my Eclipse version
Today I installed the latest version of Eclipse, Android SDK and AVD plugin. But
Today I installed the last version of MacPorts on my laptop, since then (though
MySQL Workbench was working fine till today. I installed the regular updates and now
I installed SFML from scratch today so I could work on a game. I

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.