* adjust code for task #1626.
This commit is contained in:
@@ -254,7 +254,10 @@ class webappModel extends model
|
||||
public function update($webappID)
|
||||
{
|
||||
$webapp = $this->getLocalAppByID($webappID);
|
||||
|
||||
$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($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
|
||||
|
||||
@@ -292,12 +295,16 @@ class webappModel extends model
|
||||
->add('addedDate', helper::now())
|
||||
->add('author', $this->app->user->account)
|
||||
->remove('files,customWidth,customHeight')->get();
|
||||
|
||||
$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->insert(TABLE_WEBAPP)->data($data)
|
||||
->autocheck()
|
||||
->batchCheck($this->config->webapp->create->requiredFields, 'notempty')
|
||||
->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$webappID = $this->dao->lastInsertID();
|
||||
|
||||
Reference in New Issue
Block a user