aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2021-05-06 04:00:05 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2021-05-06 04:00:05 +0000
commitf1ea4598142cd11b2bfa2f4cebf8edda34fa17e9 (patch)
tree2e56529978879ebb69ac4695a5ed92fc0f9b9819 /includes
parent3af81b2938f6206f532bd4eaf532aadb49f10629 (diff)
parentc5390fcefcad684b2644efbfe454dab3375f8155 (diff)
downloadmediawikicore-f1ea4598142cd11b2bfa2f4cebf8edda34fa17e9.tar.gz
mediawikicore-f1ea4598142cd11b2bfa2f4cebf8edda34fa17e9.zip
Merge "Remove harmful validation regex in PageReferenceValue"
Diffstat (limited to 'includes')
-rw-r--r--includes/page/PageReferenceValue.php9
1 files changed, 1 insertions, 8 deletions
diff --git a/includes/page/PageReferenceValue.php b/includes/page/PageReferenceValue.php
index 7646e237bfec..5a9032aa12e4 100644
--- a/includes/page/PageReferenceValue.php
+++ b/includes/page/PageReferenceValue.php
@@ -65,16 +65,9 @@ class PageReferenceValue implements PageReference {
Assert::parameter( $dbKey !== '', '$dbKey', 'must not be empty' );
- // Don't be mad about spaces.
+ // Replace spaces with underscores
$dbKey = str_replace( ' ', '_', $dbKey );
- // Not full validation, but catches commons issues:
- Assert::parameter(
- !preg_match( '/[\s#|]/', $dbKey ),
- '$dbKey',
- 'must be a valid title: ' . $dbKey
- );
-
$this->wikiId = $wikiId;
$this->namespace = $namespace;
$this->dbKey = $dbKey;