From 4b09d5eff2d53de9545f3b585417c1c222940270 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 4 Sep 2012 16:15:07 -0400 Subject: [PATCH] CC-4199: Webstream: Please show warning when the URL is too long -upped max webstream length to 512 -show warning if > 512 characters --- airtime_mvc/application/models/Webstream.php | 3 +++ airtime_mvc/build/schema.xml | 2 +- install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php index 476ee5490..8c74dca5a 100644 --- a/airtime_mvc/application/models/Webstream.php +++ b/airtime_mvc/application/models/Webstream.php @@ -168,6 +168,9 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable if ($result == 0) { $valid['url'][0] = false; $valid['url'][1] = 'URL should be of form "http://domain"'; + } elseif (strlen($url) > 512) { + $valid['url'][0] = false; + $valid['url'][1] = 'URL should be 512 characters or less'; } else { try { diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index 844452866..b03e14011 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -420,7 +420,7 @@ - + diff --git a/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql b/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql index aad2502f3..c2f8ba70b 100644 --- a/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql +++ b/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql @@ -95,7 +95,7 @@ CREATE TABLE cc_webstream ( id integer DEFAULT nextval('cc_webstream_id_seq'::regclass) NOT NULL, name character varying(255) NOT NULL, description character varying(255) NOT NULL, - url character varying(255) NOT NULL, + url character varying(512) NOT NULL, length interval DEFAULT '00:00:00'::interval NOT NULL, creator_id integer NOT NULL, mtime timestamp(6) without time zone NOT NULL,