* adjust judgeSuhosinSetting method to static.

This commit is contained in:
wangyidong
2017-03-22 14:12:26 +08:00
parent cec824e540
commit 2eb5ee260a
6 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -646,7 +646,7 @@ class bug extends control
/* Judge whether the editedTasks is too large and set session. */
$countInputVars = count($bugs) * (count(explode(',', $this->config->bug->custom->batchEditFields)) + 2);
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting($countInputVars);
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
/* Set Custom*/
+2 -1
View File
@@ -915,10 +915,11 @@ class commonModel extends model
* Judge Suhosin Setting whether the actual size of post data is large than the setting size.
*
* @param int $countInputVars
* @static
* @access public
* @return bool
*/
public function judgeSuhosinSetting($countInputVars)
public static function judgeSuhosinSetting($countInputVars)
{
if(extension_loaded('suhosin'))
{
+2 -2
View File
@@ -458,7 +458,7 @@ class story extends control
/* Judge whether the editedStories is too large and set session. */
$countInputVars = count($stories) * (count(explode(',', $this->config->story->custom->batchEditFields)) + 3);
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting($countInputVars);
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
$this->view->position[] = $this->lang->story->common;
@@ -810,7 +810,7 @@ class story extends control
/* Judge whether the editedStories is too large and set session. */
$countInputVars = count($stories) * $this->config->story->batchClose->columns;
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting($countInputVars);
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
$this->view->position[] = $this->lang->story->common;
+1 -1
View File
@@ -371,7 +371,7 @@ class task extends control
/* Judge whether the editedTasks is too large and set session. */
$countInputVars = count($tasks) * (count(explode(',', $this->config->task->custom->batchEditFields)) + 3);
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting($countInputVars);
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
/* Set Custom*/
+2 -2
View File
@@ -706,7 +706,7 @@ class testcase extends control
/* Judge whether the editedTasks is too large and set session. */
$countInputVars = count($cases) * (count(explode(',', $this->config->testcase->custom->batchEditFields)) + 3);
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting($countInputVars);
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
$this->loadModel('story');
@@ -1479,7 +1479,7 @@ class testcase extends control
/* Judge whether the editedTasks is too large and set session. */
$countInputVars = count($caseData) * 12 + $stepVars;
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting($countInputVars);
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
$this->view->title = $this->lang->testcase->common . $this->lang->colon . $this->lang->testcase->showImport;
+1 -1
View File
@@ -187,7 +187,7 @@ class todo extends control
/* Judge whether the edited todos is too large. */
$countInputVars = count($editedTodos) * $columns;
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting($countInputVars);
$showSuhosinInfo = common::judgeSuhosinSetting($countInputVars);
/* Set Custom*/
foreach(explode(',', $this->config->todo->list->customBatchEditFields) as $field) $customFields[$field] = $this->lang->todo->$field;