Use some PHP 5.4 constants unconditionally
This commit is contained in:
parent
3a8da96b74
commit
0caf947924
@ -243,9 +243,9 @@ class FormHelper extends Helper
|
|||||||
public function formEncodeCurrency($text, $widget = '')
|
public function formEncodeCurrency($text, $widget = '')
|
||||||
{
|
{
|
||||||
if ('UTF-8' === $charset = $this->getCharset()) {
|
if ('UTF-8' === $charset = $this->getCharset()) {
|
||||||
$text = htmlspecialchars($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
|
$text = htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||||
} else {
|
} else {
|
||||||
$text = htmlentities($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
|
$text = htmlentities($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||||
$text = iconv('UTF-8', $charset, $text);
|
$text = iconv('UTF-8', $charset, $text);
|
||||||
$widget = iconv('UTF-8', $charset, $widget);
|
$widget = iconv('UTF-8', $charset, $widget);
|
||||||
}
|
}
|
||||||
|
@ -291,9 +291,9 @@ class FormRenderer implements FormRendererInterface
|
|||||||
public function encodeCurrency(Environment $environment, $text, $widget = '')
|
public function encodeCurrency(Environment $environment, $text, $widget = '')
|
||||||
{
|
{
|
||||||
if ('UTF-8' === $charset = $environment->getCharset()) {
|
if ('UTF-8' === $charset = $environment->getCharset()) {
|
||||||
$text = htmlspecialchars($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
|
$text = htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||||
} else {
|
} else {
|
||||||
$text = htmlentities($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
|
$text = htmlentities($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||||
$text = iconv('UTF-8', $charset, $text);
|
$text = iconv('UTF-8', $charset, $text);
|
||||||
$widget = iconv('UTF-8', $charset, $widget);
|
$widget = iconv('UTF-8', $charset, $widget);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ class JsonFileDumper extends FileDumper
|
|||||||
if (isset($options['json_encoding'])) {
|
if (isset($options['json_encoding'])) {
|
||||||
$flags = $options['json_encoding'];
|
$flags = $options['json_encoding'];
|
||||||
} else {
|
} else {
|
||||||
$flags = \defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
|
$flags = JSON_PRETTY_PRINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return json_encode($messages->all($domain), $flags);
|
return json_encode($messages->all($domain), $flags);
|
||||||
|
Reference in New Issue
Block a user