Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
use 'defined('ENT_SUBSTITUTE')' instead of version compare against PH…
Browse files Browse the repository at this point in the history
…P version
  • Loading branch information
marc-mabe authored and padraic committed Jul 13, 2012
1 parent af821d0 commit 13a8c46
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/Escaper.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,21 @@ class Escaper
/**
* Static Matcher which escapes characters for HTML Attribute contexts
*
<<<<<<< HEAD
* @var Closure
=======
* @var callable
>>>>>>> Zend\Escaper (micro) optimisations
*/
protected $htmlAttrMatcher;

/**
* Static Matcher which escapes characters for Javascript contexts
*
<<<<<<< HEAD
* @var Closure
=======
* @var callable
>>>>>>> Zend\Escaper (micro) optimisations
*/
protected $jsMatcher;

/**
* Static Matcher which escapes characters for CSS Attribute contexts
*
<<<<<<< HEAD
* @var Closure
=======
* @var callable
>>>>>>> Zend\Escaper (micro) optimisations
*/
protected $cssMatcher;

Expand Down Expand Up @@ -132,8 +120,8 @@ public function __construct($encoding = null)
$this->encoding = $encoding;
}

if (version_compare(\PHP_VERSION, '5.4') >= 0) {
$this->htmlSpecialCharsFlags = \ENT_QUOTES | \ENT_SUBSTITUTE;
if (defined('ENT_SUBSTITUTE')) {
$this->htmlSpecialCharsFlags|= \ENT_SUBSTITUTE;
}

// set matcher callbacks
Expand Down

0 comments on commit 13a8c46

Please sign in to comment.