#1215: URL fields can now store up to 2048 characters

SVN:trunk[4030]
This commit is contained in:
Denis Flaven
2016-05-04 09:55:24 +00:00
parent 2b12a86fa8
commit 3c4845cf99
4 changed files with 76 additions and 2 deletions

View File

@@ -4698,6 +4698,13 @@ class AttributeURL extends AttributeString
return array_merge(parent::ListExpectedParams(), array("target"));
}
protected function GetSQLCol($bFullSpec = false) {return "VARCHAR(2048)".($bFullSpec ? $this->GetSQLColSpec() : '');}
public function GetMaxSize()
{
return 2048;
}
public function GetEditClass() {return "String";}
public function GetAsHTML($sValue, $oHostObject = null, $bLocalize = true)
@@ -4705,7 +4712,7 @@ class AttributeURL extends AttributeString
$sTarget = $this->Get("target");
if (empty($sTarget)) $sTarget = "_blank";
$sLabel = Str::pure2html($sValue);
if (strlen($sLabel) > 255)
if (strlen($sLabel) > 128)
{
// Truncate the length to 128 characters, by removing the middle
$sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20);