mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-09 23:28:42 +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:
parent
7588068b7b
commit
15988980db
@ -28,26 +28,48 @@ require_once 'HTMLPurifier/HTMLDefinition.php';
|
|||||||
require_once 'HTMLPurifier/Generator.php';
|
require_once 'HTMLPurifier/Generator.php';
|
||||||
require_once 'HTMLPurifier/Strategy/Core.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(
|
HTMLPurifier_ConfigDef::define(
|
||||||
'Core', 'Encoding', 'utf-8', 'istring',
|
'Core', 'Encoding', 'utf-8', 'istring',
|
||||||
'Defines the input and output character encodings to use. HTMLPurifier '.
|
'Set this to the encoding your webpages are served as. This defines '.
|
||||||
'internally uses UTF-8, making that the painless default choice. Note '.
|
'the encoding the HTMLPurifier will convert to and from before passing '.
|
||||||
'certain implementations of HTMLPurifier_Lexer are intelligent enough '.
|
'the text back to you. Note that although we offer full HTML document '.
|
||||||
'automatically detect encoding, however, output format will always be '.
|
'parsing functionality, we ignore meta tags in such documents, because '.
|
||||||
'this value.'
|
'most modern browsers have already re-encoded the file in the correct '.
|
||||||
);
|
'encoding (though it did not change the meta tag). '.
|
||||||
HTMLPurifier_ConfigDef::defineAllowedValues(
|
'Since browsers do not alter file uploads, '.
|
||||||
'Core', 'Encoding', array(
|
'HTML from a file will fail fantastically if its real encoding is does '.
|
||||||
'utf-8',
|
'match the encoding passed here (which is often the case).'
|
||||||
'iso-8859-1'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
HTMLPurifier_ConfigDef::defineValueAliases(
|
|
||||||
'Core', 'Encoding', array(
|
|
||||||
'iso8859-1' => 'iso-8859-1'
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
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.
|
* Main library execution class.
|
||||||
*
|
*
|
||||||
|
@ -35,7 +35,7 @@ function generate_mock_once($name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this has to be defined before we do any includes of library files
|
// 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
|
// define callable test files
|
||||||
$test_files = array();
|
$test_files = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user