Jump to content

Error when extending HTML Purifier Class


Arnsenal

Recommended Posts

Im trying to use the HTMLPurifier's class's functions inside my class by extending my class from it.  :shrug:

http://htmlpurifier.org/

 

Here is what I get for an error.

 

 

Warning: Passing a prototype to HTMLPurifier_Lexer::create() is deprecated, please instead use %Core.LexerImpl in C:\Users\Jerry\Desktop\Web Dev\Local Host - Web Dev\PHPTester\library\HTMLPurifier\Lexer.php on line 74

 

Fatal error: Call to a member function get() on a non-object in C:\Users\Jerry\Desktop\Web Dev\Local Host - Web Dev\PHPTester\library\HTMLPurifier\Lexer.php on line 80

 

 

Having a very hard time even seeking information, my knowledge of php is too limited to begin to know where to look.

 

Do I need to provide more information?

 

Thanks

 

Jerry

Thanks Thorpe

 

Yes the error is generated by Lexer.php which I attached.

 

Here is my class code that is giving me the errors.

 

require_once '/library/HTMLPurifier.auto.php';

$db_info = array ('host','user_name','password','db','table');

$purifier = new HTMLPurifier();

class s_v extends HTMLPurifier {
    
public $clean_array;
public $empty_fields_array = array();
public $invalid_fields_array = array();
private $db_info;

public function __construct($dirty_array,$db_info) {
	foreach ($dirty_array as $key => $value) {
		$value = $this->purify($value);			
	}
	$this->clean_array=$dirty_array;
	$this->db_info = $db_info;
	echo "'$this->db_info[0]'"."'$this->db_info[1]'"."'$this->db_info[2]'"."'$this->db_info[3]'";
}
}
$sv = new s_v($req_post_array,$db_info);

 

There are notes in the lexer.php file.

Thanks again. It would be awesome if you pointed me in the right direction even if you don't have time to help working out the solution.

17751_.phpFetching info...

Ok I may be on to something.

 

http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php

 

A couple questions

 

1. Am I suppose to be using :: to access functions from the class I'm extending?

 

2. If I'm extending a  class that has a constructor and I create another constructor in my extended class then instantiate the extended class do both constructors run, or does one have precedence?

 

Thanks

 

Jerry

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.