Skip to content

Commit e3f2c6b

Browse files
committed
Fix rawurlencode null arg deprecation warning
1 parent 33f8de6 commit e3f2c6b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Controllers/Document/Edit.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ public function invoke(?array $args): bool
1919
$this->model->acl_allowed = $this->model->active_user
2020
&& $this->model->active_user->getOption(\BNETDocs\Libraries\User\User::OPTION_ACL_DOCUMENT_MODIFY);
2121

22+
$this->model->document_id = Router::query()['id'] ?? null;
23+
2224
if (!$this->model->acl_allowed)
2325
{
2426
$this->model->_responseCode = HttpCode::HTTP_FORBIDDEN;
2527
$this->model->error = $this->model->active_user ? EditModel::ERROR_ACL_NOT_SET : EditModel::ERROR_NOT_LOGGED_IN;
2628
return true;
2729
}
2830

29-
$this->model->document_id = Router::query()['id'] ?? null;
30-
3131
try { $this->model->document = new \BNETDocs\Libraries\Document($this->model->document_id); }
3232
catch (\UnexpectedValueException) { $this->model->document = null; }
3333

src/Templates/Document/Edit.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $description = 'This form allows an individual to edit a document.';
88
$url = '/document/edit';
99
$comments = $this->getContext()->comments;
1010
$document_id = $this->getContext()->document_id;
11-
$document_url = ($this->getContext()->document ? $this->getContext()->document->getURI() : UrlFormatter::format('/document/' . rawurlencode($document_id)));
11+
$document_url = ($this->getContext()->document ? $this->getContext()->document->getURI() : UrlFormatter::format('/document/' . rawurlencode($document_id ?? '')));
1212
$error = $this->getContext()->error;
1313
switch ($error)
1414
{

0 commit comments

Comments
 (0)