From 6191995428719eb32e04d758459cf5df10f7b67a Mon Sep 17 00:00:00 2001 From: wyd621 Date: Tue, 30 Jul 2013 16:23:32 +0800 Subject: [PATCH] * finish task #1626. --- module/webapp/model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/webapp/model.php b/module/webapp/model.php index 48cff794fc..e486fcdeeb 100644 --- a/module/webapp/model.php +++ b/module/webapp/model.php @@ -255,6 +255,7 @@ class webappModel extends model { $webapp = $this->getLocalAppByID($webappID); $data = fixer::input('post')->remove('files,customWidth,customHeight')->get(); + if(strpos($data->url, 'http://') !== 0) $data->url = 'http://' . $data->url; if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight; $this->dao->update(TABLE_WEBAPP)->data($data)->where('id')->eq($webappID)->check('url', 'unique', "id != $webappID")->exec(); @@ -291,6 +292,7 @@ class webappModel extends model ->add('addedDate', helper::now()) ->add('author', $this->app->user->account) ->remove('files,customWidth,customHeight')->get(); + if(strpos($data->url, 'http://') !== 0) $data->url = 'http://' . $data->url; if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight; $this->dao->insert(TABLE_WEBAPP)->data($data) ->autocheck()