Same filename and directory in other branches
- 8.9.x core/modules/editor/src/EditorController.php
- 9 core/modules/editor/src/EditorController.php
Namespace
Drupal\editor
File
core/modules/editor/src/EditorController.php
View source
<?php
namespace Drupal\editor;
use Drupal\Core\Controller\ControllerBase;
use Drupal\filter\FilterFormatInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class EditorController extends ControllerBase {
public function filterXss(Request $request, FilterFormatInterface $filter_format) {
$value = $request->request
->get('value');
if (!isset($value)) {
throw new NotFoundHttpException();
}
$original_format_id = $request->request
->get('original_format_id');
$original_format = NULL;
if (isset($original_format_id)) {
$original_format = $this
->entityTypeManager()
->getStorage('filter_format')
->load($original_format_id);
}
return new JsonResponse(editor_filter_xss($value, $filter_format, $original_format));
}
}
Classes