Removing the double escape

This commit is contained in:
mlantz committed 2017-05-20 15:04:52 -04:00
1 parent 6ac052cbe5
commit 28df2ea235
4 files changed
+12 -24

No files matched your search

+5 -5
View File
@@ -485,7 +485,7 @@ class FormBuilder
// the element. Then we'll create the final textarea elements HTML for us.
$options = $this->html->attributes($options);
return $this->toHtmlString('<textarea' . $options . '>' . $this->html->escapeAll($value). '</textarea>');
return $this->toHtmlString('<textarea' . $options . '>' . $value. '</textarea>');
}
/**
@@ -662,7 +662,7 @@ class FormBuilder
$html[] = $this->option($display, $value, $selected);
}
return $this->toHtmlString('<optgroup label="' . $this->html->escapeAll($label) . '">' . implode('', $html) . '</optgroup>');
return $this->toHtmlString('<optgroup label="' . e($label) . '">' . implode('', $html) . '</optgroup>');
}
/**
@@ -680,7 +680,7 @@ class FormBuilder
$options = ['value' => $value, 'selected' => $selected];
return $this->toHtmlString('<option' . $this->html->attributes($options) . '>' . $this->html->escapeAll($display) . '</option>');
return $this->toHtmlString('<option' . $this->html->attributes($options) . '>' . e($display) . '</option>');
}
/**
@@ -694,7 +694,7 @@ class FormBuilder
protected function placeholderOption($display, $selected)
{
$selected = $this->getSelectedValue(null, $selected);
$options = [
'selected' => $selected,
'disabled' => 'disabled',
@@ -702,7 +702,7 @@ class FormBuilder
'value' => ''
];
return $this->toHtmlString('<option' . $this->html->attributes($options) . '>' . $this->html->escapeAll($display) . '</option>');
return $this->toHtmlString('<option' . $this->html->attributes($options) . '>' . e($display) . '</option>');
}
/**
+2 -14
View File
@@ -53,18 +53,6 @@ class HtmlBuilder
return htmlentities($value, ENT_QUOTES, 'UTF-8', false);
}
/**
* Convert all applicable characters to HTML entities.
*
* @param string $value
*
* @return string
*/
public function escapeAll($value)
{
return htmlentities($value, ENT_QUOTES, 'UTF-8');
}
/**
* Convert entities to HTML characters.
*
@@ -399,7 +387,7 @@ class HtmlBuilder
if (is_array($value)) {
return $this->nestedListing($key, $type, $value);
} else {
return '<li>' . $this->escapeAll($value) . '</li>';
return '<li>' . e($value) . '</li>';
}
}
@@ -461,7 +449,7 @@ class HtmlBuilder
}
if (! is_null($value)) {
return $key . '="' . $this->escapeAll($value) . '"';
return $key . '="' . e($value) . '"';
}
}