Denny Vrandecic has uploaded a new change for review.

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


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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues 
refs/changes/71/58871/1

diff --git a/DataValues/includes/values/StringValue.php 
b/DataValues/includes/values/StringValue.php
index a9164f8..678fa6d 100644
--- a/DataValues/includes/values/StringValue.php
+++ b/DataValues/includes/values/StringValue.php
@@ -51,6 +51,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/58871
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b20d0d4bad5f68cd0cc440ee1995193ecec9abd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: master
Gerrit-Owner: Denny Vrandecic <denny.vrande...@wikimedia.de>

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

Reply via email to