summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
diff options
context:
space:
mode:
authorNathaniel Catchpole2015-07-28 16:57:01 +0100
committerNathaniel Catchpole2015-07-28 17:03:59 +0100
commitf8629621bba8b37e63a46ad6b1fd28582b974a1f (patch)
tree2778f80a0cbf28cb30279e31d33413bc961bbd5e /core/modules/rest/src/Plugin/rest/resource/EntityResource.php
parent158ca154d108bcc298d38b9600d4a2a59f23d93d (diff)
Issue #2514044 by dawehner, stefan.r, alexpott: Do not use SafeMarkup::format in exceptions
Diffstat (limited to 'core/modules/rest/src/Plugin/rest/resource/EntityResource.php')
-rw-r--r--core/modules/rest/src/Plugin/rest/resource/EntityResource.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
index 8aa4dc3..464fe08 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -11,7 +11,6 @@ use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\rest\Plugin\ResourceBase;
use Drupal\rest\ResourceResponse;
-use Drupal\Component\Utility\SafeMarkup;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\HttpException;
@@ -98,7 +97,7 @@ class EntityResource extends ResourceBase {
// and 'update', so the 'edit' operation is used here.
foreach ($entity->_restSubmittedFields as $key => $field_name) {
if (!$entity->get($field_name)->access('edit')) {
- throw new AccessDeniedHttpException(SafeMarkup::format('Access denied on creating field @field', array('@field' => $field_name)));
+ throw new AccessDeniedHttpException("Access denied on creating field '$field_name'");
}
}
@@ -155,7 +154,7 @@ class EntityResource extends ResourceBase {
}
if (!$original_entity->get($field_name)->access('edit')) {
- throw new AccessDeniedHttpException(SafeMarkup::format('Access denied on updating field @field.', array('@field' => $field_name)));
+ throw new AccessDeniedHttpException("Access denied on updating field '$field_name'.");
}
$original_entity->set($field_name, $field->getValue());
}