Jens Ohlig has submitted this change and it was merged.

Change subject: Stopgap to avoid excessively long string values (backport)
......................................................................


Stopgap to avoid excessively long string values (backport)

Change-Id: I9b20d0d4bad5f68cd0cc440ee1995193ecec9abd
---
M DataValues/includes/values/StringValue.php
1 file changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Jens Ohlig: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/DataValues/includes/values/StringValue.php 
b/DataValues/includes/values/StringValue.php
index caacbe5..e23cab1 100644
--- a/DataValues/includes/values/StringValue.php
+++ b/DataValues/includes/values/StringValue.php
@@ -53,6 +53,18 @@
                        throw new InvalidArgumentException( 'Can only construct 
StringValue from strings' );
                }
 
+               // This is backporting the very evil hack I added for the last 
deployment as can be found
+               // here:
+               // 
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/DataValues.git;a=commitdiff;h=8a980bc893824dcf86be51350ede893fe950bce2
+               // 
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/DataValues.git;a=commitdiff;h=f049d35c3fd8cd69969396238a89e4dc31701f39
+               // It is still very evil. Last time I pledged that I would be 
loosing karma for a week.
+               // Since the following I had the unfortunate incident of a 
pulled hamstring - which, by
+               // the way, hurts a lot - I will refrain from committing any 
new karma this time. I hope
+               // that by the next deployment or two we can get rid of this 
terrible hack.
+               if ( mb_strlen( $value ) > 400 ) {
+                       throw new InvalidArgumentException( 'String length 
exceeds limit of 400 characters' );
+               }
+
                $this->value = $value;
        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b20d0d4bad5f68cd0cc440ee1995193ecec9abd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: mw1.21-wmf12
Gerrit-Owner: Denny Vrandecic <denny.vrande...@wikimedia.de>
Gerrit-Reviewer: Jens Ohlig <jens.oh...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to