0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-19 18:55:19 +00:00

- Switch to HTMLPurifier.php, a more logical "must include" for the tester

- Disable encoding options, we're going to defer implementation of them for a later release.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@329 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2006-08-28 02:25:19 +00:00
parent 7588068b7b
commit 15988980db
2 changed files with 39 additions and 17 deletions

View File

@ -28,26 +28,48 @@ require_once 'HTMLPurifier/HTMLDefinition.php';
require_once 'HTMLPurifier/Generator.php';
require_once 'HTMLPurifier/Strategy/Core.php';
/*
// Darn you fellas still using ISO-8859-1! It would be so easy for me
// to just drop the characters that can't be expressed this way, but I'm
// a stickler for code quality, so I won't do that to you. You'll have
// to wait for this functionality to be implemented later.
HTMLPurifier_ConfigDef::define(
'Core', 'Encoding', 'utf-8', 'istring',
'Defines the input and output character encodings to use. HTMLPurifier '.
'internally uses UTF-8, making that the painless default choice. Note '.
'certain implementations of HTMLPurifier_Lexer are intelligent enough '.
'automatically detect encoding, however, output format will always be '.
'this value.'
);
HTMLPurifier_ConfigDef::defineAllowedValues(
'Core', 'Encoding', array(
'utf-8',
'iso-8859-1'
)
);
HTMLPurifier_ConfigDef::defineValueAliases(
'Core', 'Encoding', array(
'iso8859-1' => 'iso-8859-1'
)
'Set this to the encoding your webpages are served as. This defines '.
'the encoding the HTMLPurifier will convert to and from before passing '.
'the text back to you. Note that although we offer full HTML document '.
'parsing functionality, we ignore meta tags in such documents, because '.
'most modern browsers have already re-encoded the file in the correct '.
'encoding (though it did not change the meta tag). '.
'Since browsers do not alter file uploads, '.
'HTML from a file will fail fantastically if its real encoding is does '.
'match the encoding passed here (which is often the case).'
);
if ( !function_exists('iconv') ) {
// these are the only encodings we offer native PHP support for.
// if iconv is enabled, iconv's encoding support dictates what we can
// use.
HTMLPurifier_ConfigDef::defineAllowedValues(
'Core', 'Encoding', array(
'utf-8',
'iso-8859-1'
)
);
HTMLPurifier_ConfigDef::defineValueAliases(
'Core', 'Encoding', array(
'iso8859-1' => 'iso-8859-1'
)
);
}
*/
/**
* Main library execution class.
*

View File

@ -35,7 +35,7 @@ function generate_mock_once($name) {
}
// this has to be defined before we do any includes of library files
require_once 'HTMLPurifier/ConfigDef.php';
require_once 'HTMLPurifier.php';
// define callable test files
$test_files = array();