Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions library/HTMLPurifier/AttrDef/URI/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,13 @@ public function validate($string, $config, $context)
}

// PHP 5.3 and later support this functionality natively
if (function_exists('idn_to_ascii')) {
if (defined('IDNA_NONTRANSITIONAL_TO_ASCII') && defined('INTL_IDNA_VARIANT_UTS46')) {
$string = idn_to_ascii($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
} else {
$string = idn_to_ascii($string);
}
if (\function_exists('idn_to_ascii')) {
$string = idn_to_ascii($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);

// If we have Net_IDNA2 support, we can support IRIs by
// punycoding them. (This is the most portable thing to do,
// since otherwise we have to assume browsers support
} elseif ($config->get('Core.EnableIDNA') && class_exists('Net_IDNA2')) {
} elseif (class_exists('Net_IDNA2') && $config->get('Core.EnableIDNA') ) {
$idna = new Net_IDNA2(array('encoding' => 'utf8', 'overlong' => false, 'strict' => true));
// we need to encode each period separately
$parts = explode('.', $string);
Expand Down
15 changes: 0 additions & 15 deletions library/HTMLPurifier/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@
define('HTMLPURIFIER_PREFIX', realpath(dirname(__FILE__) . '/..'));
}

// accommodations for versions earlier than 5.0.2
// borrowed from PHP_Compat, LGPL licensed, by Aidan Lister <aidan@php.net>
if (!defined('PHP_EOL')) {
switch (strtoupper(substr(PHP_OS, 0, 3))) {
case 'WIN':
define('PHP_EOL', "\r\n");
break;
case 'DAR':
define('PHP_EOL', "\r");
break;
default:
define('PHP_EOL', "\n");
}
}

/**
* Bootstrap class that contains meta-functionality for HTML Purifier such as
* the autoload function.
Expand Down
7 changes: 0 additions & 7 deletions library/HTMLPurifier/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,7 @@ protected function listify($array, $polite = false)
*/
protected function getClass($obj, $sec_prefix = '')
{
static $five = null;
if ($five === null) {
$five = version_compare(PHP_VERSION, '5', '>=');
}
$prefix = 'HTMLPurifier_' . $sec_prefix;
if (!$five) {
$prefix = strtolower($prefix);
}
$class = str_replace($prefix, '', get_class($obj));
$lclass = strtolower($class);
$class .= '(';
Expand Down
14 changes: 0 additions & 14 deletions tests/HTMLPurifier/PHPT/ze1_compatibility_mode.phpt

This file was deleted.

Loading