Completed
Push — develop ( d51988...e100be )
by Dmytro
05:27
created
manager/processors/execute_module.processor.php 1 patch
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 }
13 13
 
14 14
 // check if user has access permission, except admins
15
-if($_SESSION['mgrRole']!=1){
15
+if($_SESSION['mgrRole']!=1) {
16 16
 	$rs = $modx->db->select(
17 17
 		'sma.usergroup,mg.member',
18 18
 		$modx->getFullTableName("site_module_access")." sma
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 
63 63
 $output = evalModule($content["modulecode"],$parameter);
64
-if ( (int)$_GET['api'] != 1){
64
+if ( (int)$_GET['api'] != 1) {
65 65
 	echo "<style>body,html {overflow:auto!important;height:100%!important}</style>"; // for iframe scroller
66 66
 }
67 67
 echo $output;
@@ -74,7 +74,8 @@  discard block
 block discarded – undo
74 74
  * @param array $params
75 75
  * @return string
76 76
  */
77
-function evalModule($moduleCode,$params){
77
+function evalModule($moduleCode,$params)
78
+{
78 79
 	global $modx;
79 80
 	$modx->event->params = &$params; // store params inside event object
80 81
 	if(is_array($params)) {
@@ -84,11 +85,9 @@  discard block
 block discarded – undo
84 85
 	$mod = eval($moduleCode);
85 86
 	$msg = ob_get_contents();
86 87
 	ob_end_clean();
87
-	if (isset($php_errormsg))
88
-	{
88
+	if (isset($php_errormsg)) {
89 89
 		$error_info = error_get_last();
90
-        switch($error_info['type'])
91
-        {
90
+        switch($error_info['type']) {
92 91
         	case E_NOTICE :
93 92
         		$error_level = 1;
94 93
         	case E_USER_NOTICE :
@@ -101,8 +100,7 @@  discard block
 block discarded – undo
101 100
         	default:
102 101
         		$error_level = 99;
103 102
         }
104
-		if($modx->config['error_reporting']==='99' || 2<$error_level)
105
-		{
103
+		if($modx->config['error_reporting']==='99' || 2<$error_level) {
106 104
 			$modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg);
107 105
 			$modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>");
108 106
 		}
Please login to merge, or discard this patch.