Skip to content

Commit 372428d

Browse files
committed
fix: add missing check on special characters for page ID
1 parent ec1e48c commit 372428d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

phpmyfaq/admin/ajax.config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@
203203
$entity = new MetaEntity();
204204

205205
$entity
206-
->setPageId(Filter::filterInput(INPUT_GET, 'page_id', FILTER_UNSAFE_RAW))
207-
->setType(Filter::filterInput(INPUT_GET, 'type', FILTER_UNSAFE_RAW))
206+
->setPageId(Filter::filterInput(INPUT_GET, 'page_id', FILTER_SANITIZE_SPECIAL_CHARS))
207+
->setType(Filter::filterInput(INPUT_GET, 'type', FILTER_SANITIZE_SPECIAL_CHARS))
208208
->setContent(Filter::filterInput(INPUT_GET, 'content', FILTER_SANITIZE_SPECIAL_CHARS));
209209

210210
$metaId = $meta->add($entity);

phpmyfaq/admin/meta.edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<div class="form-group row">
5757
<label for="page_id" class="col-sm-2 col-form-label"><?= $PMF_LANG['ad_meta_page_id'] ?></label>
5858
<div class="col-sm-10">
59-
<input type="text" class="form-control" name="page_id" value="<?= $metaData->getPageId() ?>" required>
59+
<input type="text" class="form-control" name="page_id" maxlength="48" value="<?= $metaData->getPageId() ?>" required>
6060
</div>
6161
</div>
6262

phpmyfaq/admin/meta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
<div class="form-group row">
136136
<label for="page_id" class="col-sm-2 col-form-label"><?= $PMF_LANG['ad_meta_page_id'] ?></label>
137137
<div class="col-sm-10">
138-
<input type="text" class="form-control" id="page_id" required>
138+
<input type="text" class="form-control" id="page_id" maxlength="48" required>
139139
</div>
140140
</div>
141141

0 commit comments

Comments
 (0)