diff --git a/module/action/model.php b/module/action/model.php
index 1b3063b110..c55dd5d0b1 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -43,9 +43,12 @@ class actionModel extends model
$action->actor = $actor;
$action->action = $actionType;
$action->date = helper::now();
- $action->comment = $this->loadModel('file')->pasteImage(trim(strip_tags($comment, $this->config->allowedTags)), $this->post->uid);
+ $action->comment = trim(strip_tags($comment, $this->config->allowedTags));
$action->extra = $extra;
+ /* Process action. */
+ $action = $this->loadModel('file')->processEditor($action, 'comment', $this->post->uid);
+
/* Get product and project for this object. */
$productAndProject = $this->getProductAndProject($action->objectType, $objectID);
$action->product = $productAndProject['product'];
@@ -886,11 +889,15 @@ class actionModel extends model
*/
public function updateComment($actionID)
{
- $comment = $this->loadModel('file')->pasteImage(trim(strip_tags($this->post->lastComment, $this->config->allowedTags)), $this->post->uid);
$action = $this->getById($actionID);
+ $action->comment = trim(strip_tags($this->post->lastComment, $this->config->allowedTags));
+
+ /* Process action. */
+ $action = $this->loadModel('file')->processEditor($action, 'comment', $this->post->uid);
+
$this->dao->update(TABLE_ACTION)
->set('date')->eq(helper::now())
- ->set('comment')->eq($comment)
+ ->set('comment')->eq($action->comment)
->where('id')->eq($actionID)
->exec();
$this->file->updateObjectID($this->post->uid, $action->objectID, $action->objectType);
diff --git a/module/block/config.php b/module/block/config.php
index 16b7ffefad..287ee49e0e 100644
--- a/module/block/config.php
+++ b/module/block/config.php
@@ -19,3 +19,14 @@ $config->block->gridOptions[8] = '2/3';
$config->block->gridOptions[3] = '1/4';
$config->block->gridOptions[9] = '3/4';
$config->block->gridOptions[12] = '100%';
+
+$config->filterParam->get['block']['common']['hold'] = 'hash';
+$config->filterParam->get['block']['main']['hold'] = 'entry,lang,mode,blockid,blockTitle,param,sso';
+$config->filterParam->get['block']['common']['params']['hash']['reg'] = '/^[a-z0-9]{32}$/';
+$config->filterParam->get['block']['main']['params']['entry']['reg'] = '/^[a-zA-Z0-9_]+$/';
+$config->filterParam->get['block']['main']['params']['lang']['reg'] = '/^[a-zA-Z_\-]+$/';
+$config->filterParam->get['block']['main']['params']['mode']['reg'] = '/^[a-zA-Z0-9_]+$/';
+$config->filterParam->get['block']['main']['params']['blockid']['reg'] = '/^[a-zA-Z0-9]+$/';
+$config->filterParam->get['block']['main']['params']['blockTitle']['reg'] = '/./';
+$config->filterParam->get['block']['main']['params']['param']['reg'] = '/^[a-zA-Z0-9\+\/\=]+$/';
+$config->filterParam->get['block']['main']['params']['sso']['reg'] = '/^[a-zA-Z0-9\+\/\=]+$/';
diff --git a/module/block/model.php b/module/block/model.php
index 0f67a6c155..c82192e417 100644
--- a/module/block/model.php
+++ b/module/block/model.php
@@ -26,6 +26,7 @@ class blockModel extends model
$block = $id ? $this->getByID($id) : null;
$data = fixer::input('post')
->add('account', $this->app->user->account)
+ ->stripTags('html', $this->config->allowedTags)
->setIF($id, 'id', $id)
->add('order', $block ? $block->order : ($this->getLastKey($module) + 1))
->add('module', $module)
@@ -39,8 +40,11 @@ class blockModel extends model
if($type == 'html')
{
+ $uid = $this->post->uid;
+ $data = $this->loadModel('file')->processEditor($data, 'html', $uid);
$data->params['html'] = $data->html;
unset($data->html);
+ unset($_SESSION['album'][$uid]);
}
$data->params = helper::jsonEncode($data->params);
@@ -63,6 +67,7 @@ class blockModel extends model
$block->params = json_decode($block->params);
if(empty($block->params)) $block->params = new stdclass();
+ if($block->block == 'html') $block->params->html = $this->loadModel('file')->setImgSize($block->params->html);
return $block;
}
diff --git a/module/bug/config.php b/module/bug/config.php
index 525b6d7bca..b3f9dc54e4 100644
--- a/module/bug/config.php
+++ b/module/bug/config.php
@@ -276,3 +276,18 @@ $config->bug->datatable->fieldList['branch']['title'] = 'branch';
$config->bug->datatable->fieldList['branch']['fixed'] = 'left';
$config->bug->datatable->fieldList['branch']['width'] = '100';
$config->bug->datatable->fieldList['branch']['required'] = 'no';
+
+$config->filterParam->cookie['bug']['common']['hold'] = 'lastProduct,preProductID';
+$config->filterParam->cookie['bug']['browse']['hold'] = 'preBranch,bugModule,qaBugOrder,windowWidth';
+$config->filterParam->cookie['bug']['create']['hold'] = 'preBranch';
+$config->filterParam->cookie['bug']['batchcreate']['hold'] = 'preBranch';
+$config->filterParam->cookie['bug']['export']['hold'] = 'checkedItem';
+$config->filterParam->cookie['bug']['common']['params']['lastProduct']['int'] = '';
+$config->filterParam->cookie['bug']['common']['params']['preProductID']['int'] = '';
+$config->filterParam->cookie['bug']['browse']['params']['preBranch']['int'] = '';
+$config->filterParam->cookie['bug']['browse']['params']['bugModule']['int'] = '';
+$config->filterParam->cookie['bug']['browse']['params']['qaBugOrder']['reg'] = '/^[a-zA-Z0-9_]+$/';
+$config->filterParam->cookie['bug']['browse']['params']['windowWidth']['int'] = '';
+$config->filterParam->cookie['bug']['create']['params']['preBranch']['int'] = '';
+$config->filterParam->cookie['bug']['batchcreate']['params']['preBranch']['int'] = '';
+$config->filterParam->cookie['bug']['export']['params']['checkedItem']['reg'] = '/^[0-9,]+$/';
diff --git a/module/bug/model.php b/module/bug/model.php
index 828fd4f2ab..3bb38730b9 100644
--- a/module/bug/model.php
+++ b/module/bug/model.php
@@ -180,8 +180,8 @@ class bugModel extends model
$file['addedDate'] = $now;
$this->dao->insert(TABLE_FILE)->data($file)->exec();
- $url = $this->file->webPath . $file['pathname'];
- $bug->steps .= '';
+ $fileID = $this->dao->lastInsertID;
+ $bug->steps .= '
';
unset($file);
}
}
@@ -361,7 +361,8 @@ class bugModel extends model
->where('t1.id')->eq((int)$bugID)->fetch();
if(!$bug) return false;
- if($setImgSize) $bug->steps = $this->loadModel('file')->setImgSize($bug->steps);
+ $bug = $this->loadModel('file')->revertRealSRC($bug, 'steps');
+ if($setImgSize) $bug->steps = $this->file->setImgSize($bug->steps);
foreach($bug as $key => $value) if(strpos($key, 'Date') !== false and !(int)substr($value, 0, 4)) $bug->$key = '';
if($bug->duplicateBug) $bug->duplicateBugTitle = $this->dao->findById($bug->duplicateBug)->from(TABLE_BUG)->fields('title')->fetch('title');
@@ -490,8 +491,8 @@ class bugModel extends model
*/
public function update($bugID)
{
- $oldBug = $this->getById($bugID);
- if(isset($_POST['lastEditedDate']) and $oldBug->lastEditedDate != $this->post->lastEditedDate)
+ $oldBug = $this->dao->select('*')->from(TABLE_BUG)->where('id')->eq((int)$bugID)->fetch();
+ if(!empty($_POST['lastEditedDate']) and $oldBug->lastEditedDate != $this->post->lastEditedDate)
{
dao::$errors[] = $this->lang->error->editedByOther;
return false;
@@ -587,9 +588,10 @@ class bugModel extends model
}
/* Initialize bugs from the post data.*/
+ $oldBugs = $bugIDList ? $this->getList($bugIDList) : array();
foreach($bugIDList as $bugID)
{
- $oldBug = $this->getByID($bugID);
+ $oldBug = $oldBugs[$bugID];
$bug = new stdclass();
$bug->lastEditedBy = $this->app->user->account;
@@ -632,7 +634,7 @@ class bugModel extends model
/* Update bugs. */
foreach($bugs as $bugID => $bug)
{
- $oldBug = $this->getByID($bugID);
+ $oldBug = $oldBugs[$bugID];
$this->dao->update(TABLE_BUG)->data($bug)
->autoCheck()
diff --git a/module/build/model.php b/module/build/model.php
index 309b084660..89e2175a88 100644
--- a/module/build/model.php
+++ b/module/build/model.php
@@ -31,7 +31,8 @@ class buildModel extends model
->fetch();
if(!$build) return false;
- $build->files = $this->loadModel('file')->getByObject('build', $buildID);
+ $build = $this->loadModel('file')->revertRealSRC($build, 'desc');
+ $build->files = $this->file->getByObject('build', $buildID);
if($setImgSize) $build->desc = $this->file->setImgSize($build->desc);
return $build;
}
@@ -224,8 +225,8 @@ class buildModel extends model
*/
public function update($buildID)
{
- $oldBuild = $this->getByID($buildID);
- $build = fixer::input('post')->stripTags($this->config->build->editor->edit['id'], $this->config->allowedTags)
+ $oldBuild = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->eq((int)$buildID)->fetch();
+ $build = fixer::input('post')->stripTags($this->config->build->editor->edit['id'], $this->config->allowedTags)
->remove('allchecker,resolvedBy,files,labels,uid')
->get();
if(!isset($build->branch)) $build->branch = $oldBuild->branch;
diff --git a/module/common/model.php b/module/common/model.php
index 46f9cf3295..48c6d2d8ca 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -23,7 +23,6 @@ class commonModel extends model
if(!defined('FIRST_RUN'))
{
define('FIRST_RUN', true);
- $this->startSession();
$this->sendHeader();
$this->setCompany();
$this->setUser();
@@ -34,19 +33,6 @@ class commonModel extends model
}
}
- /**
- * Start the session.
- *
- * @access public
- * @return void
- */
- public function startSession()
- {
- session_name($this->config->sessionVar);
- if(isset($_GET[$this->config->sessionVar])) session_id($_GET[$this->config->sessionVar]);
- session_start();
- }
-
/**
* Set the header info.
*
@@ -126,8 +112,8 @@ class commonModel extends model
$this->config->personal = isset($config[$account]) ? $config[$account] : array();
/* Overide the items defined in config/config.php and config/my.php. */
- if(isset($this->config->system->common)) helper::mergeConfig($this->config->system->common, 'common');
- if(isset($this->config->personal->common)) helper::mergeConfig($this->config->personal->common, 'common');
+ if(isset($this->config->system->common)) $this->app->mergeConfig($this->config->system->common, 'common');
+ if(isset($this->config->personal->common)) $this->app->mergeConfig($this->config->personal->common, 'common');
}
/**
@@ -169,6 +155,7 @@ class commonModel extends model
if($module == 'sso' and $method == 'bind') return true;
if($module == 'sso' and $method == 'gettodolist') return true;
if($module == 'block' and $method == 'main') return true;
+ if($module == 'file' and $method == 'read') return true;
if($this->loadModel('user')->isLogon() or ($this->app->company->guest and $this->app->user->account == 'guest'))
{
diff --git a/module/doc/config.php b/module/doc/config.php
index 6bcb942298..03ce67dcf9 100644
--- a/module/doc/config.php
+++ b/module/doc/config.php
@@ -45,3 +45,15 @@ $config->doc->search['params']['addedDate'] = array('operator' => '=',
$config->doc->search['params']['editedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->doc->search['params']['editedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->doc->search['params']['version'] = array('operator' => '=', 'control' => 'input', 'values' => '');
+
+$config->filterParam->get['doc']['showfiles']['hold'] = 'recTotal,recPerPage,pageID,title';
+$config->filterParam->get['doc']['showfiles']['params']['recTotal']['reg'] = '/^[0-9_]+$/';
+$config->filterParam->get['doc']['showfiles']['params']['recPerPage']['reg'] = '/^[0-9]+$/';
+$config->filterParam->get['doc']['showfiles']['params']['pageID']['reg'] = '/^[0-9]+$/';
+$config->filterParam->get['doc']['showfiles']['params']['title']['reg'] = '/./';
+
+$config->filterParam->cookie['doc']['common']['hold'] = 'product,from';
+$config->filterParam->cookie['doc']['browse']['hold'] = 'browseType';
+$config->filterParam->cookie['doc']['common']['params']['product']['int'] = '';
+$config->filterParam->cookie['doc']['common']['params']['from']['code'] = '';
+$config->filterParam->cookie['doc']['browse']['params']['browseType']['reg'] = '/^by[a-z]+$/';
diff --git a/module/doc/model.php b/module/doc/model.php
index f66ca6648b..8c6581c4cb 100644
--- a/module/doc/model.php
+++ b/module/doc/model.php
@@ -351,7 +351,9 @@ class docModel extends model
$doc->digest = isset($docContent->digest) ? $docContent->digest : '';
$doc->content = isset($docContent->content) ? $docContent->content : '';
$doc->contentType = isset($docContent->type) ? $docContent->type : '';
- if($setImgSize) $doc->content = $this->loadModel('file')->setImgSize($doc->content);
+
+ $doc = $this->loadModel('file')->revertRealSRC($doc, 'content');
+ if($setImgSize) $doc->content = $this->file->setImgSize($doc->content);
$doc->files = $docFiles;
$doc->productName = '';
@@ -437,7 +439,7 @@ class docModel extends model
*/
public function update($docID)
{
- $oldDoc = $this->getById($docID);
+ $oldDoc = $this->dao->select('*')->from(TABLE_DOC)->where('id')->eq((int)$docID)->fetch();
$now = helper::now();
$doc = fixer::input('post')->setDefault('module', 0)
->stripTags($this->config->doc->editor->edit['id'], $this->config->allowedTags)
diff --git a/module/file/config.php b/module/file/config.php
index 7b55622f10..682f7e62ff 100644
--- a/module/file/config.php
+++ b/module/file/config.php
@@ -30,3 +30,11 @@ $config->file->ueditor["videoMaxSize"] = 102400000;
$config->file->ueditor["videoAllowFiles"] = array(".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid");
$config->file->ueditor["videoUrlPrefix"] = "";
$config->file->ueditor["videoPathFormat"] = "";
+
+$config->filterParam->get['file']['ajaxueditorupload']['hold'] = 'action';
+$config->filterParam->get['file']['download']['hold'] = 'charset';
+$config->filterParam->get['file']['ajaxueditorupload']['params']['action']['equal'] = 'config';
+$config->filterParam->get['file']['download']['params']['charset']['reg'] = '/^[a-zA-Z0-9\-_]+$/';
+
+$config->filterParam->cookie['file']['download']['hold'] = $config->sessionVar;
+$config->filterParam->cookie['file']['download']['params'][$config->sessionVar]['reg'] = '/^[a-zA-Z0-9]+$/';
diff --git a/module/file/control.php b/module/file/control.php
index 1e1320664c..d2d43f63fc 100644
--- a/module/file/control.php
+++ b/module/file/control.php
@@ -64,8 +64,9 @@ class file extends control
unset($file['tmpname']);
$this->dao->insert(TABLE_FILE)->data($file)->exec();
- $url = $this->file->webPath . $file['pathname'];
- if($uid) $_SESSION['album'][$uid][] = $this->dao->lastInsertID();
+ $fileID = $this->dao->lastInsertID();
+ $url = $this->createLink('file', 'read', "fileID=$fileID");
+ if($uid) $_SESSION['album'][$uid][] = $fileID;
die(json_encode(array('error' => 0, 'url' => $url)));
}
else
@@ -104,8 +105,9 @@ class file extends control
unset($file['tmpname']);
$this->dao->insert(TABLE_FILE)->data($file)->exec();
- $url = $this->file->webPath . $file['pathname'];
- if($uid) $_SESSION['album'][$uid][] = $this->dao->lastInsertID();
+ $fileID = $this->dao->lastInsertID();
+ $url = $this->createLink('file', 'read', "fileID=$fileID");
+ if($uid) $_SESSION['album'][$uid][] = $fileID;
die(json_encode(array('state' => 'SUCCESS', 'url' => $url)));
}
else
@@ -469,4 +471,27 @@ class file extends control
$this->dao->delete()->from(TABLE_USERTPL)->where('id')->eq($templateID)->andWhere('account')->eq($this->app->user->account)->exec();
die();
}
+
+ /**
+ * Read file.
+ *
+ * @param int $fileID
+ * @access public
+ * @return void
+ */
+ public function read($fileID)
+ {
+ $file = $this->file->getById($fileID);
+ if(empty($file) or !file_exists($file->realPath)) return false;
+
+ $mime = in_array($file->extension, $this->config->file->imageExtensions) ? "image/{$file->extension}" : $this->config->file->mimes['default'];
+ header("Content-type: $mime");
+
+ $handle = fopen($file->realPath, "r");
+ if($handle)
+ {
+ while(!feof($handle)) echo fgets($handle);
+ fclose($handle);
+ }
+ }
}
diff --git a/module/file/model.php b/module/file/model.php
index 871563a383..d52791444e 100644
--- a/module/file/model.php
+++ b/module/file/model.php
@@ -68,7 +68,7 @@ class fileModel extends model
{
$file = $this->dao->findById($fileID)->from(TABLE_FILE)->fetch();
$file->webPath = $this->webPath . $file->pathname;
- $file->realPath = $this->app->getAppRoot() . "www/data/upload/{$this->app->company->id}/" . $file->pathname;
+ $file->realPath = $this->savePath . $file->pathname;
return $file;
}
@@ -92,7 +92,8 @@ class fileModel extends model
foreach($files as $id => $file)
{
if($file['size'] == 0) continue;
- move_uploaded_file($file['tmpname'], $this->savePath . $file['pathname']);
+ if(!move_uploaded_file($file['tmpname'], $this->savePath . $file['pathname'])) return false;
+
$file = $this->compressImage($file);
$file['objectType'] = $objectType;
@@ -144,6 +145,7 @@ class fileModel extends model
{
if(empty($filename)) continue;
if(!validater::checkFileName($filename)) continue;
+
$title = isset($_POST[$labelsName][$id]) ? $_POST[$labelsName][$id] : '';
$file['extension'] = $this->getExtension($filename);
$file['pathname'] = $this->setPathName($id, $file['extension']);
@@ -151,7 +153,13 @@ class fileModel extends model
$file['title'] = $purifier->purify($file['title']);
$file['size'] = $size[$id];
$file['tmpname'] = $tmp_name[$id];
- $files[] = $file;
+
+ if(stripos($this->config->file->allowed, ',' . $file['extension'] . ',') === false)
+ {
+ $file['pathname'] = $file['pathname'] . '.notAllowed';
+ }
+
+ $files[] = $file;
}
}
else
@@ -166,6 +174,12 @@ class fileModel extends model
$file['title'] = $purifier->purify($file['title']);
$file['size'] = $size;
$file['tmpname'] = $tmp_name;
+
+ if(stripos($this->config->file->allowed, ',' . $file['extension'] . ',') === false)
+ {
+ $file['pathname'] = $file['pathname'] . '.notAllowed';
+ }
+
return array($file);
}
return $files;
@@ -204,6 +218,11 @@ class fileModel extends model
$file['chunks'] = isset($_POST['chunks']) ? intval($_POST['chunks']) : 0;
$file['chunk'] = isset($_POST['chunk']) ? intval($_POST['chunk']) : 0;
+ if(stripos($this->config->file->allowed, ',' . $file['extension'] . ',') === false)
+ {
+ $file['pathname'] = $file['pathname'] . '.notAllowed';
+ }
+
return $file;
}
@@ -284,7 +303,7 @@ class fileModel extends model
public function getExtension($filename)
{
$extension = trim(strtolower(pathinfo($filename, PATHINFO_EXTENSION)));
- if(empty($extension) or strpos(",{$this->config->file->dangers},", ",{$extension},") !== false) return 'txt';
+ if(empty($extension) or stripos(",{$this->config->file->dangers},", ",{$extension},") !== false) return 'txt';
if($extension == 'php') return 'txt';
return $extension;
}
@@ -339,7 +358,7 @@ class fileModel extends model
{
$sessionID = session_id();
$randString = substr($sessionID, mt_rand(0, strlen($sessionID) - 5), 3);
- return date('Ym/dHis', $this->now) . $fileID . mt_rand(0, 10000) . $randString . '.' . $extension;
+ return date('Ym/dHis', $this->now) . $fileID . mt_rand(0, 10000) . $randString;
}
/**
@@ -380,7 +399,13 @@ class fileModel extends model
*/
public function setImgSize($content, $maxSize = 0)
{
- return str_replace('src="data/upload', 'onload="setImageSize(this,' . $maxSize . ')" src="data/upload', $content);
+ if(empty($content)) return $content;
+
+ $readLinkReg = htmlspecialchars(str_replace(array('%fileID%', '/', '?'), array('[0-9]+', '\/', '\?'), helper::createLink('file', 'read', 'fileID=(%fileID%)')));
+
+ $content = preg_replace('/ src="(' . $readLinkReg . ')" /', ' onload="setImageSize(this,' . $maxSize . ')" src="$1" ', $content);
+ $content = preg_replace('/ src="{([0-9]+)}" /', ' onload="setImageSize(this,' . $maxSize . ')" src="' . helper::createLink('file', 'read', "fileID=$1") . '" ', $content);
+ return str_replace(' src="data/upload', ' onload="setImageSize(this,' . $maxSize . ')" src="data/upload', $content);
}
/**
@@ -446,9 +471,10 @@ class fileModel extends model
file_put_contents($this->savePath . $file['pathname'], $imageData);
$this->dao->insert(TABLE_FILE)->data($file)->exec();
- if($uid) $_SESSION['album'][$uid][] = $this->dao->lastInsertID();
+ $fileID = $this->dao->lastInsertID();
+ if($uid) $_SESSION['album'][$uid][] = $fileID;
- $data = str_replace($out[1][$key], $this->webPath . $file['pathname'], $data);
+ $data = str_replace($out[1][$key], helper::createLink('file', 'read', "fileID=$fileID"), $data);
}
return $data;
@@ -579,11 +605,13 @@ class fileModel extends model
*/
public function processEditor($data, $editorList, $uid = '')
{
- foreach(explode(',', $editorList) as $editorID)
+ if(is_string($editorList)) $editorList = explode(',', str_replace(' ', '', $editorList));
+ $readLinkReg = htmlspecialchars(str_replace(array('%fileID%', $this->app->getWebRoot(), '/', '?'), array('[0-9]+', '', '\/', '\?'), helper::createLink('file', 'read', 'fileID=(%fileID%)')));
+ foreach($editorList as $editorID)
{
- $editorID = trim($editorID);
- if(empty($editorID) or !isset($data->$editorID)) continue;
+ if(empty($editorID) or empty($data->$editorID)) continue;
$data->$editorID = $this->pasteImage($data->$editorID, $uid);
+ $data->$editorID = preg_replace("/ src=\"$readLinkReg\" /", ' src="{$1}" ', $data->$editorID);
}
return $data;
}
@@ -707,4 +735,24 @@ class fileModel extends model
return !dao::isError();
}
}
+
+ /**
+ * Revert real src.
+ *
+ * @param object $data
+ * @param string $fields
+ * @access public
+ * @return object
+ */
+ public function revertRealSRC($data, $fields)
+ {
+ if(is_string($fields)) $fields = explode(',', str_replace(' ', '', $fields));
+ foreach($fields as $field)
+ {
+ if(empty($field) or empty($data->$field)) continue;
+ $data->$field = preg_replace('/ src="{([0-9]+)}" /', ' src="' . helper::createLink('file', 'read', "fileID=$1") . '" ', $data->$field);
+ }
+ return $data;
+
+ }
}
diff --git a/module/mail/config.php b/module/mail/config.php
index 2fbfa040cb..ae527cc61a 100644
--- a/module/mail/config.php
+++ b/module/mail/config.php
@@ -47,3 +47,9 @@ $config->mail->provider['googlemail.com'] = $config->mail->provider['gmail
$config->mail->provider['263.net']['host'] = 'smtp.263.net';
$config->mail->provider['263xmail.com']['host'] = 'smtp.263xmail.com';
+
+$config->filterParam->get['mail']['batchdelete']['hold'] = 'idList';
+$config->filterParam->get['mail']['batchdelete']['params']['idList']['reg'] = '/^[0-9\|]+$/';
+
+$config->filterParam->cookie['mail']['ztcloud']['hold'] = 'ztCloudLicense';
+$config->filterParam->cookie['mail']['ztcloud']['params']['ztCloudLicense']['equal'] = 'yes';
diff --git a/module/mail/model.php b/module/mail/model.php
index 19490a3799..fcc002361d 100644
--- a/module/mail/model.php
+++ b/module/mail/model.php
@@ -304,7 +304,12 @@ class mailModel extends model
$this->clear();
/* Replace full webPath image for mail. */
- if(preg_match('/src="\/?data\/upload/U', $body)) $body = preg_replace('/
from(TABLE_PRODUCT)
->where('deleted')->eq(0)
@@ -321,7 +321,7 @@ class productModel extends model
public function update($productID)
{
$productID = (int)$productID;
- $oldProduct = $this->getById($productID);
+ $oldProduct = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch();
$product = fixer::input('post')
->setIF($this->post->acl != 'custom', 'whitelist', '')
->join('whitelist', ',')
diff --git a/module/productplan/model.php b/module/productplan/model.php
index 173b04f20f..b10232e07c 100644
--- a/module/productplan/model.php
+++ b/module/productplan/model.php
@@ -24,7 +24,8 @@ class productplanModel extends model
public function getByID($planID, $setImgSize = false)
{
$plan = $this->dao->findByID((int)$planID)->from(TABLE_PRODUCTPLAN)->fetch();
- if($setImgSize) $plan->desc = $this->loadModel('file')->setImgSize($plan->desc);
+ $plan = $this->loadModel('file')->revertRealSRC($plan, 'desc');
+ if($setImgSize) $plan->desc = $this->file->setImgSize($plan->desc);
return $plan;
}
@@ -161,7 +162,7 @@ class productplanModel extends model
*/
public function update($planID)
{
- $oldPlan = $this->getById($planID);
+ $oldPlan = $this->dao->findByID((int)$planID)->from(TABLE_PRODUCTPLAN)->fetch();
$plan = fixer::input('post')->stripTags($this->config->productplan->editor->edit['id'], $this->config->allowedTags)->remove('delta,uid')->get();
$plan = $this->loadModel('file')->processEditor($plan, $this->config->plan->editor->edit['id'], $this->post->uid);
$this->dao->update(TABLE_PRODUCTPLAN)
diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php
index 32de7f7eb9..67b6e0bad7 100644
--- a/module/productplan/view/view.html.php
+++ b/module/productplan/view/view.html.php
@@ -46,7 +46,7 @@
?>
-