EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/110141

Change subject: Perform topic length validation with mb_strlen
......................................................................

Perform topic length validation with mb_strlen

Bug: 57933
Change-Id: I128c9b8d0c60cb66718646e68b971db71deceab7
---
M includes/Block/Topic.php
M includes/Block/TopicList.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/41/110141/1

diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php
index 2a0feed..697363d 100644
--- a/includes/Block/Topic.php
+++ b/includes/Block/Topic.php
@@ -121,7 +121,7 @@
                        return;
                }
                $this->submitted['content'] = trim( $this->submitted['content'] 
);
-               $len = strlen( $this->submitted['content'] );
+               $len = mb_strlen( $this->submitted['content'] );
                if ( $len === 0 ) {
                        $this->addError( 'content', wfMessage( 
'flow-error-missing-title' ) );
                        return;
diff --git a/includes/Block/TopicList.php b/includes/Block/TopicList.php
index 346e30c..1528b9d 100644
--- a/includes/Block/TopicList.php
+++ b/includes/Block/TopicList.php
@@ -54,7 +54,7 @@
                        $this->submitted['topic'] = trim( 
$this->submitted['topic'] );
                        if ( strlen( $this->submitted['topic'] ) === 0 ) {
                                $this->addError( 'topic', wfMessage( 
'flow-error-missing-title' ) );
-                       } elseif ( strlen( $this->submitted['topic'] ) > 
PostRevision::MAX_TOPIC_LENGTH ) {
+                       } elseif ( mb_strlen( $this->submitted['topic'] ) > 
PostRevision::MAX_TOPIC_LENGTH ) {
                                $this->addError( 'topic', wfMessage( 
'flow-error-title-too-long', PostRevision::MAX_TOPIC_LENGTH ) );
                        }
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/110141
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I128c9b8d0c60cb66718646e68b971db71deceab7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to