stopPropagation(); $event->preventDefault(); $executingContext = ExecutionContext::getActualOrCreateFromEnv(); /** * Shared check between post and get HTTP method */ /** * Shared check between post and get HTTP method */ try { $id = ApiRouter::getRequestParameter("id"); } catch (ExceptionNotFound $e) { $executingContext->response() ->setStatus(HttpResponseStatus::BAD_REQUEST) ->setEvent($event) ->setCanonical(QualityMessageHandler::CANONICAL) ->setBody("The page id should not be empty", Mime::getHtml()) ->end(); return; } /** * Quality is just for the writers */ if (!Identity::isWriter($id)) { $executingContext->response() ->setStatus(HttpResponseStatus::NOT_AUTHORIZED) ->setEvent($event) ->setBody("Quality is only for writer", Mime::getHtml()) ->end(); return; } $markupPath = WikiPath::createMarkupPathFromId($id); $message = QualityTag::createQualityReport($markupPath); $status = $message->getStatus(); $executingContext->response() ->setStatus($status) ->setEvent($event) ->setCanonical(QualityMessageHandler::CANONICAL) ->setBody($message->getContent(), Mime::getHtml()) ->end(); } }