* fix a bug for edit webapp.

This commit is contained in:
wyd621
2013-09-05 16:59:56 +08:00
parent 3d8e60309f
commit 36ea5246db
+6 -2
View File
@@ -257,8 +257,12 @@ class webappModel extends model
$data = fixer::input('post')->remove('files,customWidth,customHeight')->get();
$data->url = trim($data->url);
if(strpos($data->url, 'http://') !== 0) $data->url = 'http://' . $data->url;
if(isset($data->url))
{
$data->url = trim($data->url);
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();