diff --git a/public_html/media/js/post-upload.js b/public_html/media/js/post-upload.js index 85eb29e8..972347c0 100644 --- a/public_html/media/js/post-upload.js +++ b/public_html/media/js/post-upload.js @@ -199,7 +199,12 @@ $(function() { postDom.data('url', url); postDom.data('file', ''); - postDom.find('[name=source]').val(url); + + var sourceInput = postDom.find('[name=source]'); + sourceInput.val(url); + if (sourceInput.attr('maxlength')) + sourceInput.val(sourceInput.val().substring(0, sourceInput.attr('maxlength'))); + if (matches = url.match(/watch.*?=([a-zA-Z0-9_-]+)/)) { postDom.find('.file-name strong').text(url); diff --git a/src/Views/input/input-basic.phtml b/src/Views/input/input-basic.phtml index 2a791e9e..e59000eb 100644 --- a/src/Views/input/input-basic.phtml +++ b/src/Views/input/input-basic.phtml @@ -8,6 +8,7 @@ $placeholder = isset($this->context->placeholder) ? $this->context->placeholder $additionalInfo = isset($this->context->additionalInfo) ? $this->context->additionalInfo : ''; $inputClass = isset($this->context->inputClass) ? $this->context->inputClass : ''; $noAutocomplete = isset($this->context->noAutocomplete) ? true : false; +$maxLength = isset($this->context->maxLength) ? intval($this->context->maxLength) : null; ?>