Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Check HTMLPurifier class already loaded before direct inclusion #1

Merged
merged 1 commit into from

2 participants

@robocoder

Good for autoloaders

@fentie
Owner

Thanks. You might also want to submit this to funkatron/inspekt if you haven't already since my version is just a fork. I'm not sure when I'll be working on this project next.

@fentie fentie merged commit 9e3b6b1 into fentie:master
@robocoder

Sure, I'll try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 5 deletions.
  1. +7 −5 Inspekt/Cage.php
View
12 Inspekt/Cage.php
@@ -168,11 +168,13 @@ public function count()
*/
public function loadHTMLPurifier($path = null, $opts = null)
{
- if (isset($path)) {
- include_once $path;
- } else {
- include_once 'HTMLPurifier.auto.php';
- }
+ if (!class_exists('HTMLPurifier')) {
+ if (isset($path)) {
+ include_once $path;
+ } else {
+ include_once 'HTMLPurifier.auto.php';
+ }
+ }
$config = null;
if (isset($opts) && is_array($opts)) {
Something went wrong with that request. Please try again.