@@ -22,14 +22,14 @@ discard block |
||
22 | 22 | * @param array $tvsArray |
23 | 23 | * @return string |
24 | 24 | */ |
25 | -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) |
|
25 | +function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()) |
|
26 | 26 | { |
27 | 27 | $modx = evolutionCMS(); |
28 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
28 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
29 | 29 | $nvalue = trim($value); |
30 | 30 | if (substr($nvalue, 0, 1) != '@') { |
31 | 31 | return $value; |
32 | - } elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { |
|
32 | + } elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings'] != 1 && $src === 'docform') { |
|
33 | 33 | return '@Bindings is disabled.'; |
34 | 34 | } else { |
35 | 35 | list($cmd, $param) = ParseCommand($nvalue); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | case 'DIRECTORY': |
101 | 101 | $files = array(); |
102 | - $path = $modx->config['base_path'] . $param; |
|
102 | + $path = $modx->config['base_path'].$param; |
|
103 | 103 | if (substr($path, -1, 1) != '/') { |
104 | 104 | $path .= '/'; |
105 | 105 | } |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | global $BINDINGS; |
153 | 153 | $binding_array = array(); |
154 | 154 | foreach ($BINDINGS as $cmd) { |
155 | - if (strpos($binding_string, '@' . $cmd)===0) { |
|
156 | - $code = substr($binding_string, strlen($cmd)+1); |
|
157 | - $binding_array = array($cmd,trim($code)); |
|
155 | + if (strpos($binding_string, '@'.$cmd) === 0) { |
|
156 | + $code = substr($binding_string, strlen($cmd) + 1); |
|
157 | + $binding_array = array($cmd, trim($code)); |
|
158 | 158 | break; |
159 | 159 | } |
160 | 160 | } |
@@ -175,12 +175,12 @@ discard block |
||
175 | 175 | if (strpos($param, '[*') !== false) { |
176 | 176 | $matches = $modx->getTagsFromContent($param, '[*', '*]'); |
177 | 177 | foreach ($matches[0] as $i=>$match) { |
178 | - if (isset($tvsArray[ $matches[1][$i] ])) { |
|
179 | - if (is_array($tvsArray[ $matches[1][$i] ])) { |
|
178 | + if (isset($tvsArray[$matches[1][$i]])) { |
|
179 | + if (is_array($tvsArray[$matches[1][$i]])) { |
|
180 | 180 | $value = $tvsArray[$matches[1][$i]]['value']; |
181 | 181 | $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; |
182 | 182 | } else { |
183 | - $value = $tvsArray[ $matches[1][$i] ]; |
|
183 | + $value = $tvsArray[$matches[1][$i]]; |
|
184 | 184 | } |
185 | 185 | $param = str_replace($match, $value, $param); |
186 | 186 | } |
@@ -8,23 +8,23 @@ |
||
8 | 8 | * |
9 | 9 | */ |
10 | 10 | |
11 | - require_once(dirname(__FILE__) . '/protect.inc.php'); |
|
11 | + require_once(dirname(__FILE__).'/protect.inc.php'); |
|
12 | 12 | |
13 | 13 | $sysMsgs = ""; |
14 | 14 | $limit = count($SystemAlertMsgQueque); |
15 | - for ($i=0;$i<$limit;$i++) { |
|
16 | - $sysMsgs .= $SystemAlertMsgQueque[$i] . "<hr sys/>"; |
|
15 | + for ($i = 0; $i < $limit; $i++) { |
|
16 | + $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
|
17 | 17 | } |
18 | 18 | // reset message queque |
19 | 19 | unset($_SESSION['SystemAlertMsgQueque']); |
20 | 20 | $_SESSION['SystemAlertMsgQueque'] = array(); |
21 | 21 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
22 | 22 | |
23 | - if ($sysMsgs!="") { |
|
23 | + if ($sysMsgs != "") { |
|
24 | 24 | ?> |
25 | 25 | |
26 | 26 | <?php // fetch the styles |
27 | - echo '<link rel="stylesheet" type="text/css" href="' . MODX_MANAGER_URL . 'media/style/' . $manager_theme . '/style.css' . '" />'; ?> |
|
27 | + echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />'; ?> |
|
28 | 28 | <script type="text/javascript"> |
29 | 29 | // <![CDATA[ |
30 | 30 | window.addEvent('domready', function() { |
@@ -102,16 +102,16 @@ |
||
102 | 102 | $modx->setPlaceholder('login_form_position_class', 'loginbox-' . $modx->config['login_form_position']); |
103 | 103 | |
104 | 104 | switch ($modx->config['manager_theme_mode']) { |
105 | - case '1': |
|
105 | + case '1': |
|
106 | 106 | $modx->setPlaceholder('manager_theme_style', 'lightness'); |
107 | 107 | break; |
108 | - case '2': |
|
108 | + case '2': |
|
109 | 109 | $modx->setPlaceholder('manager_theme_style', 'light'); |
110 | 110 | break; |
111 | - case '3': |
|
111 | + case '3': |
|
112 | 112 | $modx->setPlaceholder('manager_theme_style', 'dark'); |
113 | 113 | break; |
114 | - case '4': |
|
114 | + case '4': |
|
115 | 115 | $modx->setPlaceholder('manager_theme_style', 'darkness'); |
116 | 116 | break; |
117 | 117 | } |
@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | // andrazk 20070416 - if installer is running, destroy active sessions |
21 | -if (file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) { |
|
22 | - include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php'); |
|
21 | +if (file_exists(MODX_BASE_PATH.'assets/cache/installProc.inc.php')) { |
|
22 | + include_once(MODX_BASE_PATH.'assets/cache/installProc.inc.php'); |
|
23 | 23 | if (isset($installStartTime)) { |
24 | 24 | if ((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard |
25 | 25 | unset($installStartTime); |
26 | - @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755); |
|
27 | - unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php'); |
|
26 | + @ chmod(MODX_BASE_PATH.'assets/cache/installProc.inc.php', 0755); |
|
27 | + unlink(MODX_BASE_PATH.'assets/cache/installProc.inc.php'); |
|
28 | 28 | } else { |
29 | 29 | if ($_SERVER['REQUEST_METHOD'] != 'POST') { |
30 | 30 | if (isset($_COOKIE[session_name()])) { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | // setcookie(session_name(), '', 0, MODX_BASE_URL); |
51 | 51 | } |
52 | 52 | header('HTTP/1.0 307 Redirect'); |
53 | - header('Location: ' . MODX_MANAGER_URL . 'index.php?installGoingOn=2'); |
|
53 | + header('Location: '.MODX_MANAGER_URL.'index.php?installGoingOn=2'); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | // establish fallback to English default |
63 | 63 | include_once "lang/english.inc.php"; |
64 | 64 | // include localized overrides |
65 | - include_once "lang/" . $manager_language . ".inc.php"; |
|
65 | + include_once "lang/".$manager_language.".inc.php"; |
|
66 | 66 | } else { |
67 | 67 | include_once "lang/english.inc.php"; |
68 | 68 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $modx->setPlaceholder('modx_charset', $modx_manager_charset); |
71 | 71 | $modx->setPlaceholder('theme', $manager_theme); |
72 | 72 | $modx->setPlaceholder('favicon', |
73 | - (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico')); |
|
73 | + (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.$modx->config['manager_theme'].'/images/favicon.ico')); |
|
74 | 74 | |
75 | 75 | // invoke OnManagerLoginFormPrerender event |
76 | 76 | $evtOut = $modx->invokeEvent('OnManagerLoginFormPrerender'); |
@@ -81,25 +81,25 @@ discard block |
||
81 | 81 | $modx->setPlaceholder('manager_path', MGR_DIR); |
82 | 82 | $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); |
83 | 83 | $modx->setPlaceholder('login_message', $_lang["login_message"]); |
84 | - $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); |
|
84 | + $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/'); |
|
85 | 85 | $modx->setPlaceholder('year', date('Y')); |
86 | 86 | |
87 | 87 | // set login logo image |
88 | 88 | if (!empty($modx->config['login_logo'])) { |
89 | - $modx->setPlaceholder('login_logo', MODX_SITE_URL . $modx->config['login_logo']); |
|
89 | + $modx->setPlaceholder('login_logo', MODX_SITE_URL.$modx->config['login_logo']); |
|
90 | 90 | } else { |
91 | - $modx->setPlaceholder('login_logo', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-logo.png'); |
|
91 | + $modx->setPlaceholder('login_logo', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/images/login/default/login-logo.png'); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | // set login background image |
95 | 95 | if (!empty($modx->config['login_bg'])) { |
96 | - $modx->setPlaceholder('login_bg', MODX_SITE_URL . $modx->config['login_bg']); |
|
96 | + $modx->setPlaceholder('login_bg', MODX_SITE_URL.$modx->config['login_bg']); |
|
97 | 97 | } else { |
98 | - $modx->setPlaceholder('login_bg', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-background.jpg'); |
|
98 | + $modx->setPlaceholder('login_bg', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/images/login/default/login-background.jpg'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // set form position css class |
102 | - $modx->setPlaceholder('login_form_position_class', 'loginbox-' . $modx->config['login_form_position']); |
|
102 | + $modx->setPlaceholder('login_form_position_class', 'loginbox-'.$modx->config['login_form_position']); |
|
103 | 103 | |
104 | 104 | switch ($modx->config['manager_theme_mode']) { |
105 | 105 | case '1': |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | switch ($installGoingOn) { |
125 | 125 | case 1: |
126 | 126 | $modx->setPlaceholder('login_message', |
127 | - "<p><span class=\"fail\">" . $_lang["login_cancelled_install_in_progress"] . "</p><p>" . $_lang["login_message"] . "</p>"); |
|
127 | + "<p><span class=\"fail\">".$_lang["login_cancelled_install_in_progress"]."</p><p>".$_lang["login_message"]."</p>"); |
|
128 | 128 | break; |
129 | 129 | case 2: |
130 | 130 | $modx->setPlaceholder('login_message', |
131 | - "<p><span class=\"fail\">" . $_lang["login_cancelled_site_was_updated"] . "</p><p>" . $_lang["login_message"] . "</p>"); |
|
131 | + "<p><span class=\"fail\">".$_lang["login_cancelled_site_was_updated"]."</p><p>".$_lang["login_message"]."</p>"); |
|
132 | 132 | break; |
133 | 133 | } |
134 | 134 | } |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | if ($modx->config['use_captcha'] == 1) { |
137 | 137 | $modx->setPlaceholder('login_captcha_message', $_lang["login_captcha_message"]); |
138 | 138 | $modx->setPlaceholder('captcha_image', |
139 | - '<a href="' . MODX_MANAGER_URL . '" class="loginCaptcha"><img id="captcha_image" src="' . MODX_MANAGER_URL . 'includes/veriword.php?rand=' . rand() . '" alt="' . $_lang["login_captcha_message"] . '" /></a>'); |
|
139 | + '<a href="'.MODX_MANAGER_URL.'" class="loginCaptcha"><img id="captcha_image" src="'.MODX_MANAGER_URL.'includes/veriword.php?rand='.rand().'" alt="'.$_lang["login_captcha_message"].'" /></a>'); |
|
140 | 140 | $modx->setPlaceholder('captcha_input', |
141 | - '<label>' . $_lang["captcha_code"] . '</label> <input type="text" name="captcha_code" tabindex="3" value="" />'); |
|
141 | + '<label>'.$_lang["captcha_code"].'</label> <input type="text" name="captcha_code" tabindex="3" value="" />'); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | // login info |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | // invoke OnManagerLoginFormRender event |
158 | 158 | $evtOut = $modx->invokeEvent('OnManagerLoginFormRender'); |
159 | - $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">' . implode('', $evtOut) . '</div>' : ''; |
|
159 | + $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">'.implode('', $evtOut).'</div>' : ''; |
|
160 | 160 | $modx->setPlaceholder('OnManagerLoginFormRender', $html); |
161 | 161 | |
162 | 162 | // load template |
@@ -174,29 +174,29 @@ discard block |
||
174 | 174 | $login_tpl = file_get_contents($target); |
175 | 175 | } |
176 | 176 | } else { |
177 | - $theme_path = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/'; |
|
178 | - if (is_file($theme_path . 'style.php')) { |
|
179 | - include($theme_path . 'style.php'); |
|
177 | + $theme_path = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/'; |
|
178 | + if (is_file($theme_path.'style.php')) { |
|
179 | + include($theme_path.'style.php'); |
|
180 | 180 | } |
181 | 181 | $chunk = $modx->getChunk($target); |
182 | 182 | if ($chunk !== false && !empty($chunk)) { |
183 | 183 | $login_tpl = $chunk; |
184 | - } elseif (is_file(MODX_BASE_PATH . $target)) { |
|
185 | - $target = MODX_BASE_PATH . $target; |
|
184 | + } elseif (is_file(MODX_BASE_PATH.$target)) { |
|
185 | + $target = MODX_BASE_PATH.$target; |
|
186 | 186 | $login_tpl = file_get_contents($target); |
187 | 187 | } elseif (is_file($target)) { |
188 | 188 | $login_tpl = file_get_contents($target); |
189 | - } elseif (is_file($theme_path . 'login.tpl')) { |
|
190 | - $target = $theme_path . 'login.tpl'; |
|
189 | + } elseif (is_file($theme_path.'login.tpl')) { |
|
190 | + $target = $theme_path.'login.tpl'; |
|
191 | 191 | $login_tpl = file_get_contents($target); |
192 | - } elseif (is_file($theme_path . 'templates/actions/login.tpl')) { |
|
193 | - $target = $theme_path . 'templates/actions/login.tpl'; |
|
192 | + } elseif (is_file($theme_path.'templates/actions/login.tpl')) { |
|
193 | + $target = $theme_path.'templates/actions/login.tpl'; |
|
194 | 194 | $login_tpl = file_get_contents($target); |
195 | - } elseif (is_file($theme_path . 'html/login.html')) { // ClipperCMS compatible |
|
196 | - $target = $theme_path . 'html/login.html'; |
|
195 | + } elseif (is_file($theme_path.'html/login.html')) { // ClipperCMS compatible |
|
196 | + $target = $theme_path.'html/login.html'; |
|
197 | 197 | $login_tpl = file_get_contents($target); |
198 | 198 | } else { |
199 | - $target = MODX_MANAGER_PATH . 'media/style/common/login.tpl'; |
|
199 | + $target = MODX_MANAGER_PATH.'media/style/common/login.tpl'; |
|
200 | 200 | $login_tpl = file_get_contents($target); |
201 | 201 | } |
202 | 202 | } |
@@ -215,17 +215,17 @@ discard block |
||
215 | 215 | $modx->updateValidatedUserSession(); |
216 | 216 | |
217 | 217 | // Update last action in table active_users |
218 | - $itemid = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : ''; |
|
218 | + $itemid = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : ''; |
|
219 | 219 | $lasthittime = time(); |
220 | - $action = isset($_REQUEST['a']) ? (int)$_REQUEST['a'] : 1; |
|
220 | + $action = isset($_REQUEST['a']) ? (int) $_REQUEST['a'] : 1; |
|
221 | 221 | |
222 | 222 | if ($action !== 1) { |
223 | - if ((int)$itemid <= 0) { |
|
223 | + if ((int) $itemid <= 0) { |
|
224 | 224 | $itemid = null; |
225 | 225 | } |
226 | 226 | $sql = sprintf("REPLACE INTO %s (sid, internalKey, username, lasthit, action, id) VALUES ('%s', %d, '%s', %d, '%s', %s)", |
227 | 227 | $modx->getFullTableName('active_users') // Table |
228 | - , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string)$action, |
|
228 | + , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string) $action, |
|
229 | 229 | $itemid == null ? var_export(null, true) : $itemid); |
230 | 230 | $modx->db->query($sql); |
231 | 231 | } |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | |
22 | 22 | $output = ''; |
23 | 23 | $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
24 | - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
|
24 | + $tab = isset($config['tab']) ? ' AND tab IN('.$config['tab'].')' : ''; |
|
25 | 25 | |
26 | 26 | if ($action) { |
27 | 27 | $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
28 | - FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 |
|
29 | - INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category |
|
30 | - WHERE t1.action IN(' . $action . ') ' . $tab . ' |
|
28 | + FROM ' . $modx->getFullTableName('system_templates').' AS t1 |
|
29 | + INNER JOIN ' . $modx->getFullTableName('categories').' AS t2 ON t2.id=t1.category |
|
30 | + WHERE t1.action IN(' . $action.') '.$tab.' |
|
31 | 31 | ORDER BY t1.tab ASC, t1.rank ASC'); |
32 | 32 | |
33 | 33 | if ($modx->db->getRecordCount($sql)) { |
@@ -43,17 +43,17 @@ discard block |
||
43 | 43 | if (!empty($config['toArray'])) { |
44 | 44 | $output = $tabs; |
45 | 45 | } else { |
46 | - $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
|
46 | + $output .= '<div class="tab-pane" id="pane_'.$action.'">'; |
|
47 | 47 | $output .= ' |
48 | 48 | <script type="text/javascript"> |
49 | - var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
49 | + var pane_' . $action.' = new WebFXTabPane(document.getElementById("pane_'.$action.'"), '.($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
50 | 50 | </script>'; |
51 | 51 | |
52 | 52 | foreach ($tabs as $idTab => $tab) { |
53 | - $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
|
53 | + $output .= '<div class="tab-page" id="tab_'.$action.'_'.$idTab.'">'; |
|
54 | 54 | $output .= ' |
55 | - <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2> |
|
56 | - <script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>'; |
|
55 | + <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']).'</h2> |
|
56 | + <script type="text/javascript">pane_' . $action.'.addTabPage(document.getElementById("tab_'.$action.'_'.$idTab.'"));</script>'; |
|
57 | 57 | unset($tab['category_name']); |
58 | 58 | foreach ($tab as $item) { |
59 | 59 | $output .= $item; |
@@ -120,16 +120,16 @@ discard block |
||
120 | 120 | $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
121 | 121 | if ($data['name'] == 'country' && isset($_country_lang)) { |
122 | 122 | $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
123 | - $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
|
123 | + $output .= '<option value=""'.(!isset($chosenCountry) ? ' selected' : '').'> </option>'; |
|
124 | 124 | foreach ($_country_lang as $key => $value) { |
125 | - $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
|
125 | + $output .= '<option value="'.$key.'"'.(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').'>'.$value.'</option>'; |
|
126 | 126 | } |
127 | 127 | } else { |
128 | 128 | if ($data['elements']) { |
129 | 129 | $elements = explode('||', $data['elements']); |
130 | 130 | foreach ($elements as $key => $value) { |
131 | 131 | $value = explode('==', $value); |
132 | - $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
|
132 | + $output .= '<option value="'.$value[1].'">'.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]).'</option>'; |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $elements = explode('||', $data['elements']); |
148 | 148 | foreach ($elements as $key => $value) { |
149 | 149 | $value = explode('==', $value); |
150 | - $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
150 | + $output .= '<br /><input type="checkbox" name="'.$value[0].'" class="form-control" id="'.$value[0].'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | $output .= $data['content']; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $elements = explode('||', $data['elements']); |
164 | 164 | foreach ($elements as $key => $value) { |
165 | 165 | $value = explode('==', $value); |
166 | - $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
166 | + $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_'.$key.'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | $output .= $data['content']; |
@@ -7,55 +7,55 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -class TemplateParser |
|
11 | -{ |
|
10 | +class TemplateParser |
|
11 | +{ |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $config [action, tabs, toArray] |
15 | 15 | * @param array $data |
16 | 16 | * @return string |
17 | 17 | */ |
18 | - public function output($config = array(), $data = array()) |
|
19 | - { |
|
18 | + public function output($config = array(), $data = array()) |
|
19 | + { |
|
20 | 20 | $modx = evolutionCMS(); |
21 | 21 | |
22 | 22 | $output = ''; |
23 | 23 | $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
24 | 24 | $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
25 | 25 | |
26 | - if ($action) { |
|
26 | + if ($action) { |
|
27 | 27 | $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
28 | 28 | FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 |
29 | 29 | INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category |
30 | 30 | WHERE t1.action IN(' . $action . ') ' . $tab . ' |
31 | 31 | ORDER BY t1.tab ASC, t1.rank ASC'); |
32 | 32 | |
33 | - if ($modx->db->getRecordCount($sql)) { |
|
33 | + if ($modx->db->getRecordCount($sql)) { |
|
34 | 34 | $tabs = array(); |
35 | - while ($row = $modx->db->getRow($sql)) { |
|
36 | - if (!$row['value'] && !empty($data[$row['name']])) { |
|
35 | + while ($row = $modx->db->getRow($sql)) { |
|
36 | + if (!$row['value'] && !empty($data[$row['name']])) { |
|
37 | 37 | $row['value'] = $data[$row['name']]; |
38 | 38 | } |
39 | 39 | $tabs[$row['tab']]['category_name'] = $row['category_name']; |
40 | 40 | $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); |
41 | 41 | } |
42 | 42 | |
43 | - if (!empty($config['toArray'])) { |
|
43 | + if (!empty($config['toArray'])) { |
|
44 | 44 | $output = $tabs; |
45 | - } else { |
|
45 | + } else { |
|
46 | 46 | $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
47 | 47 | $output .= ' |
48 | 48 | <script type="text/javascript"> |
49 | 49 | var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
50 | 50 | </script>'; |
51 | 51 | |
52 | - foreach ($tabs as $idTab => $tab) { |
|
52 | + foreach ($tabs as $idTab => $tab) { |
|
53 | 53 | $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
54 | 54 | $output .= ' |
55 | 55 | <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2> |
56 | 56 | <script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>'; |
57 | 57 | unset($tab['category_name']); |
58 | - foreach ($tab as $item) { |
|
58 | + foreach ($tab as $item) { |
|
59 | 59 | $output .= $item; |
60 | 60 | } |
61 | 61 | $output .= '</div>'; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @param array $data |
73 | 73 | * @return string |
74 | 74 | */ |
75 | - private function render($data) |
|
76 | - { |
|
75 | + private function render($data) |
|
76 | + { |
|
77 | 77 | $modx = evolutionCMS(); |
78 | 78 | global $_lang, $_country_lang; |
79 | 79 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $output = ''; |
85 | 85 | $output .= '<div class="form-group row">'; |
86 | 86 | |
87 | - switch ($data['type']) { |
|
87 | + switch ($data['type']) { |
|
88 | 88 | |
89 | 89 | case 'text': |
90 | 90 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
@@ -118,16 +118,16 @@ discard block |
||
118 | 118 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
119 | 119 | $output .= '<div class="col-sm-7">'; |
120 | 120 | $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
121 | - if ($data['name'] == 'country' && isset($_country_lang)) { |
|
121 | + if ($data['name'] == 'country' && isset($_country_lang)) { |
|
122 | 122 | $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
123 | 123 | $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
124 | - foreach ($_country_lang as $key => $value) { |
|
124 | + foreach ($_country_lang as $key => $value) { |
|
125 | 125 | $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
126 | 126 | } |
127 | - } else { |
|
128 | - if ($data['elements']) { |
|
127 | + } else { |
|
128 | + if ($data['elements']) { |
|
129 | 129 | $elements = explode('||', $data['elements']); |
130 | - foreach ($elements as $key => $value) { |
|
130 | + foreach ($elements as $key => $value) { |
|
131 | 131 | $value = explode('==', $value); |
132 | 132 | $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
133 | 133 | } |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
144 | 144 | $output .= '<div class="col-sm-7">'; |
145 | 145 | $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
146 | - if ($data['elements']) { |
|
146 | + if ($data['elements']) { |
|
147 | 147 | $elements = explode('||', $data['elements']); |
148 | - foreach ($elements as $key => $value) { |
|
148 | + foreach ($elements as $key => $value) { |
|
149 | 149 | $value = explode('==', $value); |
150 | 150 | $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
151 | 151 | } |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
160 | 160 | $output .= '<div class="col-sm-7">'; |
161 | 161 | $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
162 | - if ($data['elements']) { |
|
162 | + if ($data['elements']) { |
|
163 | 163 | $elements = explode('||', $data['elements']); |
164 | - foreach ($elements as $key => $value) { |
|
164 | + foreach ($elements as $key => $value) { |
|
165 | 165 | $value = explode('==', $value); |
166 | 166 | $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
167 | 167 | } |
@@ -1076,10 +1076,10 @@ discard block |
||
1076 | 1076 | $list = imap_rfc822_parse_adrlist($addrstr, ''); |
1077 | 1077 | foreach ($list as $address) { |
1078 | 1078 | if ('.SYNTAX-ERROR.' != $address->host) { |
1079 | - if (static::validateAddress($address->mailbox . '@' . $address->host)) { |
|
1079 | + if (static::validateAddress($address->mailbox.'@'.$address->host)) { |
|
1080 | 1080 | $addresses[] = array( |
1081 | 1081 | 'name' => (property_exists($address, 'personal') ? $address->personal : ''), |
1082 | - 'address' => $address->mailbox . '@' . $address->host, |
|
1082 | + 'address' => $address->mailbox.'@'.$address->host, |
|
1083 | 1083 | ); |
1084 | 1084 | } |
1085 | 1085 | } |
@@ -1225,14 +1225,14 @@ discard block |
||
1225 | 1225 | * Feel free to use and redistribute this code. But please keep this copyright notice. |
1226 | 1226 | */ |
1227 | 1227 | return (bool) preg_match( |
1228 | - '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . |
|
1229 | - '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . |
|
1230 | - '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . |
|
1231 | - '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . |
|
1232 | - '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . |
|
1233 | - '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . |
|
1234 | - '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . |
|
1235 | - '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . |
|
1228 | + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)'. |
|
1229 | + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)'. |
|
1230 | + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)'. |
|
1231 | + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*'. |
|
1232 | + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)'. |
|
1233 | + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}'. |
|
1234 | + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:'. |
|
1235 | + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}'. |
|
1236 | 1236 | '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', |
1237 | 1237 | $address |
1238 | 1238 | ); |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | * @see http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) |
1244 | 1244 | */ |
1245 | 1245 | return (bool) preg_match( |
1246 | - '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . |
|
1246 | + '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}'. |
|
1247 | 1247 | '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', |
1248 | 1248 | $address |
1249 | 1249 | ); |
@@ -1294,7 +1294,7 @@ discard block |
||
1294 | 1294 | $errorcode = 0; |
1295 | 1295 | $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46); |
1296 | 1296 | if (false !== $punycode) { |
1297 | - return substr($address, 0, $pos) . $punycode; |
|
1297 | + return substr($address, 0, $pos).$punycode; |
|
1298 | 1298 | } |
1299 | 1299 | } |
1300 | 1300 | } |
@@ -1358,8 +1358,8 @@ discard block |
||
1358 | 1358 | and version_compare(PHP_VERSION, '7.1.3', '<'))) |
1359 | 1359 | ) { |
1360 | 1360 | trigger_error( |
1361 | - 'Your version of PHP is affected by a bug that may result in corrupted messages.' . |
|
1362 | - ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . |
|
1361 | + 'Your version of PHP is affected by a bug that may result in corrupted messages.'. |
|
1362 | + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in'. |
|
1363 | 1363 | ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', |
1364 | 1364 | E_USER_WARNING |
1365 | 1365 | ); |
@@ -1443,12 +1443,12 @@ discard block |
||
1443 | 1443 | ) |
1444 | 1444 | ) { |
1445 | 1445 | $header_dkim = $this->DKIM_Add( |
1446 | - $this->MIMEHeader . $this->mailHeader, |
|
1446 | + $this->MIMEHeader.$this->mailHeader, |
|
1447 | 1447 | $this->encodeHeader($this->secureHeader($this->Subject)), |
1448 | 1448 | $this->MIMEBody |
1449 | 1449 | ); |
1450 | - $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . static::$LE . |
|
1451 | - static::normalizeBreaks($header_dkim) . static::$LE; |
|
1450 | + $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ").static::$LE. |
|
1451 | + static::normalizeBreaks($header_dkim).static::$LE; |
|
1452 | 1452 | } |
1453 | 1453 | |
1454 | 1454 | return true; |
@@ -1482,7 +1482,7 @@ discard block |
||
1482 | 1482 | case 'mail': |
1483 | 1483 | return $this->mailSend($this->MIMEHeader, $this->MIMEBody); |
1484 | 1484 | default: |
1485 | - $sendMethod = $this->Mailer . 'Send'; |
|
1485 | + $sendMethod = $this->Mailer.'Send'; |
|
1486 | 1486 | if (method_exists($this, $sendMethod)) { |
1487 | 1487 | return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); |
1488 | 1488 | } |
@@ -1535,9 +1535,9 @@ discard block |
||
1535 | 1535 | foreach ($this->SingleToArray as $toAddr) { |
1536 | 1536 | $mail = @popen($sendmail, 'w'); |
1537 | 1537 | if (!$mail) { |
1538 | - throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
|
1538 | + throw new Exception($this->lang('execute').$this->Sendmail, self::STOP_CRITICAL); |
|
1539 | 1539 | } |
1540 | - fwrite($mail, 'To: ' . $toAddr . "\n"); |
|
1540 | + fwrite($mail, 'To: '.$toAddr."\n"); |
|
1541 | 1541 | fwrite($mail, $header); |
1542 | 1542 | fwrite($mail, $body); |
1543 | 1543 | $result = pclose($mail); |
@@ -1552,13 +1552,13 @@ discard block |
||
1552 | 1552 | array() |
1553 | 1553 | ); |
1554 | 1554 | if (0 !== $result) { |
1555 | - throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
|
1555 | + throw new Exception($this->lang('execute').$this->Sendmail, self::STOP_CRITICAL); |
|
1556 | 1556 | } |
1557 | 1557 | } |
1558 | 1558 | } else { |
1559 | 1559 | $mail = @popen($sendmail, 'w'); |
1560 | 1560 | if (!$mail) { |
1561 | - throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
|
1561 | + throw new Exception($this->lang('execute').$this->Sendmail, self::STOP_CRITICAL); |
|
1562 | 1562 | } |
1563 | 1563 | fwrite($mail, $header); |
1564 | 1564 | fwrite($mail, $body); |
@@ -1574,7 +1574,7 @@ discard block |
||
1574 | 1574 | array() |
1575 | 1575 | ); |
1576 | 1576 | if (0 !== $result) { |
1577 | - throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
|
1577 | + throw new Exception($this->lang('execute').$this->Sendmail, self::STOP_CRITICAL); |
|
1578 | 1578 | } |
1579 | 1579 | } |
1580 | 1580 | |
@@ -1732,7 +1732,7 @@ discard block |
||
1732 | 1732 | $smtp_from = $this->Sender; |
1733 | 1733 | } |
1734 | 1734 | if (!$this->smtp->mail($smtp_from)) { |
1735 | - $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); |
|
1735 | + $this->setError($this->lang('from_failed').$smtp_from.' : '.implode(',', $this->smtp->getError())); |
|
1736 | 1736 | throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); |
1737 | 1737 | } |
1738 | 1738 | |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | } |
1754 | 1754 | |
1755 | 1755 | // Only send the DATA command if we have viable recipients |
1756 | - if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { |
|
1756 | + if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header.$body)) { |
|
1757 | 1757 | throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL); |
1758 | 1758 | } |
1759 | 1759 | |
@@ -1783,10 +1783,10 @@ discard block |
||
1783 | 1783 | if (count($bad_rcpt) > 0) { |
1784 | 1784 | $errstr = ''; |
1785 | 1785 | foreach ($bad_rcpt as $bad) { |
1786 | - $errstr .= $bad['to'] . ': ' . $bad['error']; |
|
1786 | + $errstr .= $bad['to'].': '.$bad['error']; |
|
1787 | 1787 | } |
1788 | 1788 | throw new Exception( |
1789 | - $this->lang('recipients_failed') . $errstr, |
|
1789 | + $this->lang('recipients_failed').$errstr, |
|
1790 | 1790 | self::STOP_CONTINUE |
1791 | 1791 | ); |
1792 | 1792 | } |
@@ -1836,7 +1836,7 @@ discard block |
||
1836 | 1836 | trim($hostentry), |
1837 | 1837 | $hostinfo |
1838 | 1838 | )) { |
1839 | - static::edebug($this->lang('connect_host') . ' ' . $hostentry); |
|
1839 | + static::edebug($this->lang('connect_host').' '.$hostentry); |
|
1840 | 1840 | // Not a valid host entry |
1841 | 1841 | continue; |
1842 | 1842 | } |
@@ -1848,7 +1848,7 @@ discard block |
||
1848 | 1848 | |
1849 | 1849 | //Check the host name is a valid name or IP address before trying to use it |
1850 | 1850 | if (!static::isValidHost($hostinfo[3])) { |
1851 | - static::edebug($this->lang('connect_host') . ' ' . $hostentry); |
|
1851 | + static::edebug($this->lang('connect_host').' '.$hostentry); |
|
1852 | 1852 | continue; |
1853 | 1853 | } |
1854 | 1854 | $prefix = ''; |
@@ -1868,7 +1868,7 @@ discard block |
||
1868 | 1868 | if ('tls' === $secure or 'ssl' === $secure) { |
1869 | 1869 | //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled |
1870 | 1870 | if (!$sslext) { |
1871 | - throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL); |
|
1871 | + throw new Exception($this->lang('extension_missing').'openssl', self::STOP_CRITICAL); |
|
1872 | 1872 | } |
1873 | 1873 | } |
1874 | 1874 | $host = $hostinfo[3]; |
@@ -1877,7 +1877,7 @@ discard block |
||
1877 | 1877 | if ($tport > 0 and $tport < 65536) { |
1878 | 1878 | $port = $tport; |
1879 | 1879 | } |
1880 | - if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { |
|
1880 | + if ($this->smtp->connect($prefix.$host, $port, $this->Timeout, $options)) { |
|
1881 | 1881 | try { |
1882 | 1882 | if ($this->Helo) { |
1883 | 1883 | $hello = $this->Helo; |
@@ -1994,14 +1994,14 @@ discard block |
||
1994 | 1994 | ); |
1995 | 1995 | if (empty($lang_path)) { |
1996 | 1996 | // Calculate an absolute path so it can work if CWD is not here |
1997 | - $lang_path = __DIR__ . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; |
|
1997 | + $lang_path = __DIR__.DIRECTORY_SEPARATOR.'language'.DIRECTORY_SEPARATOR; |
|
1998 | 1998 | } |
1999 | 1999 | //Validate $langcode |
2000 | 2000 | if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { |
2001 | 2001 | $langcode = 'en'; |
2002 | 2002 | } |
2003 | 2003 | $foundlang = true; |
2004 | - $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; |
|
2004 | + $lang_file = $lang_path.'phpmailer.lang-'.$langcode.'.php'; |
|
2005 | 2005 | // There is no English translation file |
2006 | 2006 | if ('en' != $langcode) { |
2007 | 2007 | // Make sure language file path is readable |
@@ -2046,7 +2046,7 @@ discard block |
||
2046 | 2046 | $addresses[] = $this->addrFormat($address); |
2047 | 2047 | } |
2048 | 2048 | |
2049 | - return $type . ': ' . implode(', ', $addresses) . static::$LE; |
|
2049 | + return $type.': '.implode(', ', $addresses).static::$LE; |
|
2050 | 2050 | } |
2051 | 2051 | |
2052 | 2052 | /** |
@@ -2063,9 +2063,9 @@ discard block |
||
2063 | 2063 | return $this->secureHeader($addr[0]); |
2064 | 2064 | } |
2065 | 2065 | |
2066 | - return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader( |
|
2066 | + return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase').' <'.$this->secureHeader( |
|
2067 | 2067 | $addr[0] |
2068 | - ) . '>'; |
|
2068 | + ).'>'; |
|
2069 | 2069 | } |
2070 | 2070 | |
2071 | 2071 | /** |
@@ -2122,10 +2122,10 @@ discard block |
||
2122 | 2122 | } |
2123 | 2123 | $part = substr($word, 0, $len); |
2124 | 2124 | $word = substr($word, $len); |
2125 | - $buf .= ' ' . $part; |
|
2126 | - $message .= $buf . sprintf('=%s', static::$LE); |
|
2125 | + $buf .= ' '.$part; |
|
2126 | + $message .= $buf.sprintf('=%s', static::$LE); |
|
2127 | 2127 | } else { |
2128 | - $message .= $buf . $soft_break; |
|
2128 | + $message .= $buf.$soft_break; |
|
2129 | 2129 | } |
2130 | 2130 | $buf = ''; |
2131 | 2131 | } |
@@ -2145,7 +2145,7 @@ discard block |
||
2145 | 2145 | $word = substr($word, $len); |
2146 | 2146 | |
2147 | 2147 | if (strlen($word) > 0) { |
2148 | - $message .= $part . sprintf('=%s', static::$LE); |
|
2148 | + $message .= $part.sprintf('=%s', static::$LE); |
|
2149 | 2149 | } else { |
2150 | 2150 | $buf = $part; |
2151 | 2151 | } |
@@ -2158,13 +2158,13 @@ discard block |
||
2158 | 2158 | $buf .= $word; |
2159 | 2159 | |
2160 | 2160 | if (strlen($buf) > $length and '' != $buf_o) { |
2161 | - $message .= $buf_o . $soft_break; |
|
2161 | + $message .= $buf_o.$soft_break; |
|
2162 | 2162 | $buf = $word; |
2163 | 2163 | } |
2164 | 2164 | } |
2165 | 2165 | $firstword = false; |
2166 | 2166 | } |
2167 | - $message .= $buf . static::$LE; |
|
2167 | + $message .= $buf.static::$LE; |
|
2168 | 2168 | } |
2169 | 2169 | |
2170 | 2170 | return $message; |
@@ -2310,7 +2310,7 @@ discard block |
||
2310 | 2310 | if ('' == $this->XMailer) { |
2311 | 2311 | $result .= $this->headerLine( |
2312 | 2312 | 'X-Mailer', |
2313 | - 'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)' |
|
2313 | + 'PHPMailer '.self::VERSION.' (https://github.com/PHPMailer/PHPMailer)' |
|
2314 | 2314 | ); |
2315 | 2315 | } else { |
2316 | 2316 | $myXmailer = trim($this->XMailer); |
@@ -2320,7 +2320,7 @@ discard block |
||
2320 | 2320 | } |
2321 | 2321 | |
2322 | 2322 | if ('' != $this->ConfirmReadingTo) { |
2323 | - $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); |
|
2323 | + $result .= $this->headerLine('Disposition-Notification-To', '<'.$this->ConfirmReadingTo.'>'); |
|
2324 | 2324 | } |
2325 | 2325 | |
2326 | 2326 | // Add custom headers |
@@ -2350,23 +2350,23 @@ discard block |
||
2350 | 2350 | switch ($this->message_type) { |
2351 | 2351 | case 'inline': |
2352 | 2352 | $result .= $this->headerLine('Content-Type', 'multipart/related;'); |
2353 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
2353 | + $result .= $this->textLine("\tboundary=\"".$this->boundary[1].'"'); |
|
2354 | 2354 | break; |
2355 | 2355 | case 'attach': |
2356 | 2356 | case 'inline_attach': |
2357 | 2357 | case 'alt_attach': |
2358 | 2358 | case 'alt_inline_attach': |
2359 | 2359 | $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); |
2360 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
2360 | + $result .= $this->textLine("\tboundary=\"".$this->boundary[1].'"'); |
|
2361 | 2361 | break; |
2362 | 2362 | case 'alt': |
2363 | 2363 | case 'alt_inline': |
2364 | 2364 | $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
2365 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
2365 | + $result .= $this->textLine("\tboundary=\"".$this->boundary[1].'"'); |
|
2366 | 2366 | break; |
2367 | 2367 | default: |
2368 | 2368 | // Catches case 'plain': and case '': |
2369 | - $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); |
|
2369 | + $result .= $this->textLine('Content-Type: '.$this->ContentType.'; charset='.$this->CharSet); |
|
2370 | 2370 | $ismultipart = false; |
2371 | 2371 | break; |
2372 | 2372 | } |
@@ -2401,7 +2401,7 @@ discard block |
||
2401 | 2401 | */ |
2402 | 2402 | public function getSentMIMEMessage() |
2403 | 2403 | { |
2404 | - return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . static::$LE . static::$LE . $this->MIMEBody; |
|
2404 | + return rtrim($this->MIMEHeader.$this->mailHeader, "\n\r").static::$LE.static::$LE.$this->MIMEBody; |
|
2405 | 2405 | } |
2406 | 2406 | |
2407 | 2407 | /** |
@@ -2438,12 +2438,12 @@ discard block |
||
2438 | 2438 | $body = ''; |
2439 | 2439 | //Create unique IDs and preset boundaries |
2440 | 2440 | $this->uniqueid = $this->generateId(); |
2441 | - $this->boundary[1] = 'b1_' . $this->uniqueid; |
|
2442 | - $this->boundary[2] = 'b2_' . $this->uniqueid; |
|
2443 | - $this->boundary[3] = 'b3_' . $this->uniqueid; |
|
2441 | + $this->boundary[1] = 'b1_'.$this->uniqueid; |
|
2442 | + $this->boundary[2] = 'b2_'.$this->uniqueid; |
|
2443 | + $this->boundary[3] = 'b3_'.$this->uniqueid; |
|
2444 | 2444 | |
2445 | 2445 | if ($this->sign_key_file) { |
2446 | - $body .= $this->getMailMIME() . static::$LE; |
|
2446 | + $body .= $this->getMailMIME().static::$LE; |
|
2447 | 2447 | } |
2448 | 2448 | |
2449 | 2449 | $this->setWordWrap(); |
@@ -2476,7 +2476,7 @@ discard block |
||
2476 | 2476 | $altBodyEncoding = 'quoted-printable'; |
2477 | 2477 | } |
2478 | 2478 | //Use this as a preamble in all multipart message types |
2479 | - $mimepre = 'This is a multi-part message in MIME format.' . static::$LE; |
|
2479 | + $mimepre = 'This is a multi-part message in MIME format.'.static::$LE; |
|
2480 | 2480 | switch ($this->message_type) { |
2481 | 2481 | case 'inline': |
2482 | 2482 | $body .= $mimepre; |
@@ -2494,9 +2494,9 @@ discard block |
||
2494 | 2494 | break; |
2495 | 2495 | case 'inline_attach': |
2496 | 2496 | $body .= $mimepre; |
2497 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
2497 | + $body .= $this->textLine('--'.$this->boundary[1]); |
|
2498 | 2498 | $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
2499 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
2499 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[2].'"'); |
|
2500 | 2500 | $body .= static::$LE; |
2501 | 2501 | $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); |
2502 | 2502 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
@@ -2525,9 +2525,9 @@ discard block |
||
2525 | 2525 | $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
2526 | 2526 | $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
2527 | 2527 | $body .= static::$LE; |
2528 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
2528 | + $body .= $this->textLine('--'.$this->boundary[1]); |
|
2529 | 2529 | $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
2530 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
2530 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[2].'"'); |
|
2531 | 2531 | $body .= static::$LE; |
2532 | 2532 | $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); |
2533 | 2533 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
@@ -2538,9 +2538,9 @@ discard block |
||
2538 | 2538 | break; |
2539 | 2539 | case 'alt_attach': |
2540 | 2540 | $body .= $mimepre; |
2541 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
2541 | + $body .= $this->textLine('--'.$this->boundary[1]); |
|
2542 | 2542 | $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
2543 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
2543 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[2].'"'); |
|
2544 | 2544 | $body .= static::$LE; |
2545 | 2545 | $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
2546 | 2546 | $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
@@ -2558,16 +2558,16 @@ discard block |
||
2558 | 2558 | break; |
2559 | 2559 | case 'alt_inline_attach': |
2560 | 2560 | $body .= $mimepre; |
2561 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
2561 | + $body .= $this->textLine('--'.$this->boundary[1]); |
|
2562 | 2562 | $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
2563 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
2563 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[2].'"'); |
|
2564 | 2564 | $body .= static::$LE; |
2565 | 2565 | $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
2566 | 2566 | $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
2567 | 2567 | $body .= static::$LE; |
2568 | - $body .= $this->textLine('--' . $this->boundary[2]); |
|
2568 | + $body .= $this->textLine('--'.$this->boundary[2]); |
|
2569 | 2569 | $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
2570 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); |
|
2570 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[3].'"'); |
|
2571 | 2571 | $body .= static::$LE; |
2572 | 2572 | $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); |
2573 | 2573 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
@@ -2594,12 +2594,12 @@ discard block |
||
2594 | 2594 | } elseif ($this->sign_key_file) { |
2595 | 2595 | try { |
2596 | 2596 | if (!defined('PKCS7_TEXT')) { |
2597 | - throw new Exception($this->lang('extension_missing') . 'openssl'); |
|
2597 | + throw new Exception($this->lang('extension_missing').'openssl'); |
|
2598 | 2598 | } |
2599 | 2599 | // @TODO would be nice to use php://temp streams here |
2600 | 2600 | $file = tempnam(sys_get_temp_dir(), 'mail'); |
2601 | 2601 | if (false === file_put_contents($file, $body)) { |
2602 | - throw new Exception($this->lang('signing') . ' Could not write temp file'); |
|
2602 | + throw new Exception($this->lang('signing').' Could not write temp file'); |
|
2603 | 2603 | } |
2604 | 2604 | $signed = tempnam(sys_get_temp_dir(), 'signed'); |
2605 | 2605 | //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 |
@@ -2607,16 +2607,16 @@ discard block |
||
2607 | 2607 | $sign = @openssl_pkcs7_sign( |
2608 | 2608 | $file, |
2609 | 2609 | $signed, |
2610 | - 'file://' . realpath($this->sign_cert_file), |
|
2611 | - array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), |
|
2610 | + 'file://'.realpath($this->sign_cert_file), |
|
2611 | + array('file://'.realpath($this->sign_key_file), $this->sign_key_pass), |
|
2612 | 2612 | array() |
2613 | 2613 | ); |
2614 | 2614 | } else { |
2615 | 2615 | $sign = @openssl_pkcs7_sign( |
2616 | 2616 | $file, |
2617 | 2617 | $signed, |
2618 | - 'file://' . realpath($this->sign_cert_file), |
|
2619 | - array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), |
|
2618 | + 'file://'.realpath($this->sign_cert_file), |
|
2619 | + array('file://'.realpath($this->sign_key_file), $this->sign_key_pass), |
|
2620 | 2620 | array(), |
2621 | 2621 | PKCS7_DETACHED, |
2622 | 2622 | $this->sign_extracerts_file |
@@ -2628,11 +2628,11 @@ discard block |
||
2628 | 2628 | @unlink($signed); |
2629 | 2629 | //The message returned by openssl contains both headers and body, so need to split them up |
2630 | 2630 | $parts = explode("\n\n", $body, 2); |
2631 | - $this->MIMEHeader .= $parts[0] . static::$LE . static::$LE; |
|
2631 | + $this->MIMEHeader .= $parts[0].static::$LE.static::$LE; |
|
2632 | 2632 | $body = $parts[1]; |
2633 | 2633 | } else { |
2634 | 2634 | @unlink($signed); |
2635 | - throw new Exception($this->lang('signing') . openssl_error_string()); |
|
2635 | + throw new Exception($this->lang('signing').openssl_error_string()); |
|
2636 | 2636 | } |
2637 | 2637 | } catch (Exception $exc) { |
2638 | 2638 | $body = ''; |
@@ -2667,7 +2667,7 @@ discard block |
||
2667 | 2667 | if ('' == $encoding) { |
2668 | 2668 | $encoding = $this->Encoding; |
2669 | 2669 | } |
2670 | - $result .= $this->textLine('--' . $boundary); |
|
2670 | + $result .= $this->textLine('--'.$boundary); |
|
2671 | 2671 | $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); |
2672 | 2672 | $result .= static::$LE; |
2673 | 2673 | // RFC1341 part 5 says 7bit is assumed if not specified |
@@ -2688,7 +2688,7 @@ discard block |
||
2688 | 2688 | */ |
2689 | 2689 | protected function endBoundary($boundary) |
2690 | 2690 | { |
2691 | - return static::$LE . '--' . $boundary . '--' . static::$LE; |
|
2691 | + return static::$LE.'--'.$boundary.'--'.static::$LE; |
|
2692 | 2692 | } |
2693 | 2693 | |
2694 | 2694 | /** |
@@ -2724,7 +2724,7 @@ discard block |
||
2724 | 2724 | */ |
2725 | 2725 | public function headerLine($name, $value) |
2726 | 2726 | { |
2727 | - return $name . ': ' . $value . static::$LE; |
|
2727 | + return $name.': '.$value.static::$LE; |
|
2728 | 2728 | } |
2729 | 2729 | |
2730 | 2730 | /** |
@@ -2736,7 +2736,7 @@ discard block |
||
2736 | 2736 | */ |
2737 | 2737 | public function textLine($value) |
2738 | 2738 | { |
2739 | - return $value . static::$LE; |
|
2739 | + return $value.static::$LE; |
|
2740 | 2740 | } |
2741 | 2741 | |
2742 | 2742 | /** |
@@ -2758,7 +2758,7 @@ discard block |
||
2758 | 2758 | { |
2759 | 2759 | try { |
2760 | 2760 | if (!@is_file($path)) { |
2761 | - throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); |
|
2761 | + throw new Exception($this->lang('file_access').$path, self::STOP_CONTINUE); |
|
2762 | 2762 | } |
2763 | 2763 | |
2764 | 2764 | // If a MIME type is not specified, try to work it out from the file name |
@@ -2885,7 +2885,7 @@ discard block |
||
2885 | 2885 | 'Content-Disposition: %s; filename="%s"%s', |
2886 | 2886 | $disposition, |
2887 | 2887 | $encoded_name, |
2888 | - static::$LE . static::$LE |
|
2888 | + static::$LE.static::$LE |
|
2889 | 2889 | ); |
2890 | 2890 | } else { |
2891 | 2891 | if (!empty($encoded_name)) { |
@@ -2893,13 +2893,13 @@ discard block |
||
2893 | 2893 | 'Content-Disposition: %s; filename=%s%s', |
2894 | 2894 | $disposition, |
2895 | 2895 | $encoded_name, |
2896 | - static::$LE . static::$LE |
|
2896 | + static::$LE.static::$LE |
|
2897 | 2897 | ); |
2898 | 2898 | } else { |
2899 | 2899 | $mime[] = sprintf( |
2900 | 2900 | 'Content-Disposition: %s%s', |
2901 | 2901 | $disposition, |
2902 | - static::$LE . static::$LE |
|
2902 | + static::$LE.static::$LE |
|
2903 | 2903 | ); |
2904 | 2904 | } |
2905 | 2905 | } |
@@ -2940,11 +2940,11 @@ discard block |
||
2940 | 2940 | { |
2941 | 2941 | try { |
2942 | 2942 | if (!file_exists($path)) { |
2943 | - throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); |
|
2943 | + throw new Exception($this->lang('file_open').$path, self::STOP_CONTINUE); |
|
2944 | 2944 | } |
2945 | 2945 | $file_buffer = file_get_contents($path); |
2946 | 2946 | if (false === $file_buffer) { |
2947 | - throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); |
|
2947 | + throw new Exception($this->lang('file_open').$path, self::STOP_CONTINUE); |
|
2948 | 2948 | } |
2949 | 2949 | $file_buffer = $this->encodeString($file_buffer, $encoding); |
2950 | 2950 | |
@@ -2991,7 +2991,7 @@ discard block |
||
2991 | 2991 | $encoded = $this->encodeQP($str); |
2992 | 2992 | break; |
2993 | 2993 | default: |
2994 | - $this->setError($this->lang('encoding') . $encoding); |
|
2994 | + $this->setError($this->lang('encoding').$encoding); |
|
2995 | 2995 | break; |
2996 | 2996 | } |
2997 | 2997 | |
@@ -3058,7 +3058,7 @@ discard block |
||
3058 | 3058 | $maxlen -= $maxlen % 4; |
3059 | 3059 | $encoded = trim(chunk_split($encoded, $maxlen, "\n")); |
3060 | 3060 | } |
3061 | - $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); |
|
3061 | + $encoded = preg_replace('/^(.*)$/m', ' =?'.$this->CharSet."?$encoding?\\1?=", $encoded); |
|
3062 | 3062 | } elseif ($matchcount > 0) { |
3063 | 3063 | //1 or more chars need encoding, use Q-encode |
3064 | 3064 | $encoding = 'Q'; |
@@ -3066,8 +3066,8 @@ discard block |
||
3066 | 3066 | $maxlen = static::STD_LINE_LENGTH - $lengthsub - 8 - strlen($this->CharSet); |
3067 | 3067 | $encoded = $this->encodeQ($str, $position); |
3068 | 3068 | $encoded = $this->wrapText($encoded, $maxlen, true); |
3069 | - $encoded = str_replace('=' . static::$LE, "\n", trim($encoded)); |
|
3070 | - $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); |
|
3069 | + $encoded = str_replace('='.static::$LE, "\n", trim($encoded)); |
|
3070 | + $encoded = preg_replace('/^(.*)$/m', ' =?'.$this->CharSet."?$encoding?\\1?=", $encoded); |
|
3071 | 3071 | } elseif (strlen($str) > $maxlen) { |
3072 | 3072 | //No chars need encoding, but line is too long, so fold it |
3073 | 3073 | $encoded = trim($this->wrapText($str, $maxlen, false)); |
@@ -3128,7 +3128,7 @@ discard block |
||
3128 | 3128 | */ |
3129 | 3129 | public function base64EncodeWrapMB($str, $linebreak = null) |
3130 | 3130 | { |
3131 | - $start = '=?' . $this->CharSet . '?B?'; |
|
3131 | + $start = '=?'.$this->CharSet.'?B?'; |
|
3132 | 3132 | $end = '?='; |
3133 | 3133 | $encoded = ''; |
3134 | 3134 | if (null === $linebreak) { |
@@ -3151,7 +3151,7 @@ discard block |
||
3151 | 3151 | $chunk = base64_encode($chunk); |
3152 | 3152 | ++$lookBack; |
3153 | 3153 | } while (strlen($chunk) > $length); |
3154 | - $encoded .= $chunk . $linebreak; |
|
3154 | + $encoded .= $chunk.$linebreak; |
|
3155 | 3155 | } |
3156 | 3156 | |
3157 | 3157 | // Chomp the last linefeed |
@@ -3205,7 +3205,7 @@ discard block |
||
3205 | 3205 | // RFC 2047 section 5.1 |
3206 | 3206 | // Replace every high ascii, control, =, ? and _ characters |
3207 | 3207 | /** @noinspection SuspiciousAssignmentsInspection */ |
3208 | - $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; |
|
3208 | + $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377'.$pattern; |
|
3209 | 3209 | break; |
3210 | 3210 | } |
3211 | 3211 | $matches = array(); |
@@ -3218,7 +3218,7 @@ discard block |
||
3218 | 3218 | array_unshift($matches[0], '='); |
3219 | 3219 | } |
3220 | 3220 | foreach (array_unique($matches[0]) as $char) { |
3221 | - $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); |
|
3221 | + $encoded = str_replace($char, '='.sprintf('%02X', ord($char)), $encoded); |
|
3222 | 3222 | } |
3223 | 3223 | } |
3224 | 3224 | // Replace spaces with _ (more readable than =20) |
@@ -3243,7 +3243,7 @@ discard block |
||
3243 | 3243 | $encoding = 'base64', |
3244 | 3244 | $type = '', |
3245 | 3245 | $disposition = 'attachment' |
3246 | - ) { |
|
3246 | + ){ |
|
3247 | 3247 | // If a MIME type is not specified, try to work it out from the file name |
3248 | 3248 | if ('' == $type) { |
3249 | 3249 | $type = static::filenameToType($filename); |
@@ -3283,7 +3283,7 @@ discard block |
||
3283 | 3283 | public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') |
3284 | 3284 | { |
3285 | 3285 | if (!@is_file($path)) { |
3286 | - $this->setError($this->lang('file_access') . $path); |
|
3286 | + $this->setError($this->lang('file_access').$path); |
|
3287 | 3287 | |
3288 | 3288 | return false; |
3289 | 3289 | } |
@@ -3337,7 +3337,7 @@ discard block |
||
3337 | 3337 | $encoding = 'base64', |
3338 | 3338 | $type = '', |
3339 | 3339 | $disposition = 'inline' |
3340 | - ) { |
|
3340 | + ){ |
|
3341 | 3341 | // If a MIME type is not specified, try to work it out from the name |
3342 | 3342 | if ('' == $type and !empty($name)) { |
3343 | 3343 | $type = static::filenameToType($name); |
@@ -3427,7 +3427,7 @@ discard block |
||
3427 | 3427 | { |
3428 | 3428 | $this->RecipientsQueue = array_filter( |
3429 | 3429 | $this->RecipientsQueue, |
3430 | - function ($params) use ($kind) { |
|
3430 | + function($params) use ($kind) { |
|
3431 | 3431 | return $params[0] != $kind; |
3432 | 3432 | } |
3433 | 3433 | ); |
@@ -3517,15 +3517,15 @@ discard block |
||
3517 | 3517 | if ('smtp' == $this->Mailer and null !== $this->smtp) { |
3518 | 3518 | $lasterror = $this->smtp->getError(); |
3519 | 3519 | if (!empty($lasterror['error'])) { |
3520 | - $msg .= $this->lang('smtp_error') . $lasterror['error']; |
|
3520 | + $msg .= $this->lang('smtp_error').$lasterror['error']; |
|
3521 | 3521 | if (!empty($lasterror['detail'])) { |
3522 | - $msg .= ' Detail: ' . $lasterror['detail']; |
|
3522 | + $msg .= ' Detail: '.$lasterror['detail']; |
|
3523 | 3523 | } |
3524 | 3524 | if (!empty($lasterror['smtp_code'])) { |
3525 | - $msg .= ' SMTP code: ' . $lasterror['smtp_code']; |
|
3525 | + $msg .= ' SMTP code: '.$lasterror['smtp_code']; |
|
3526 | 3526 | } |
3527 | 3527 | if (!empty($lasterror['smtp_code_ex'])) { |
3528 | - $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; |
|
3528 | + $msg .= ' Additional SMTP info: '.$lasterror['smtp_code_ex']; |
|
3529 | 3529 | } |
3530 | 3530 | } |
3531 | 3531 | } |
@@ -3598,7 +3598,7 @@ discard block |
||
3598 | 3598 | //Is it a valid IPv4 address? |
3599 | 3599 | return (bool) filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); |
3600 | 3600 | } |
3601 | - if (filter_var('http://' . $host, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED)) { |
|
3601 | + if (filter_var('http://'.$host, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED)) { |
|
3602 | 3602 | //Is it a syntactically valid hostname? |
3603 | 3603 | return true; |
3604 | 3604 | } |
@@ -3624,7 +3624,7 @@ discard block |
||
3624 | 3624 | //Include a link to troubleshooting docs on SMTP connection failure |
3625 | 3625 | //this is by far the biggest cause of support questions |
3626 | 3626 | //but it's usually not PHPMailer's fault. |
3627 | - return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; |
|
3627 | + return $this->language[$key].' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; |
|
3628 | 3628 | } |
3629 | 3629 | |
3630 | 3630 | return $this->language[$key]; |
@@ -3712,14 +3712,14 @@ discard block |
||
3712 | 3712 | } |
3713 | 3713 | //Hash the decoded data, not the URL so that the same data-URI image used in multiple places |
3714 | 3714 | //will only be embedded once, even if it used a different encoding |
3715 | - $cid = hash('sha256', $data) . '@phpmailer.0'; // RFC2392 S 2 |
|
3715 | + $cid = hash('sha256', $data).'@phpmailer.0'; // RFC2392 S 2 |
|
3716 | 3716 | |
3717 | 3717 | if (!$this->cidExists($cid)) { |
3718 | - $this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1]); |
|
3718 | + $this->addStringEmbeddedImage($data, $cid, 'embed'.$imgindex, 'base64', $match[1]); |
|
3719 | 3719 | } |
3720 | 3720 | $message = str_replace( |
3721 | 3721 | $images[0][$imgindex], |
3722 | - $images[1][$imgindex] . '="cid:' . $cid . '"', |
|
3722 | + $images[1][$imgindex].'="cid:'.$cid.'"', |
|
3723 | 3723 | $message |
3724 | 3724 | ); |
3725 | 3725 | continue; |
@@ -3738,7 +3738,7 @@ discard block |
||
3738 | 3738 | if ('.' == $directory) { |
3739 | 3739 | $directory = ''; |
3740 | 3740 | } |
3741 | - $cid = hash('sha256', $url) . '@phpmailer.0'; // RFC2392 S 2 |
|
3741 | + $cid = hash('sha256', $url).'@phpmailer.0'; // RFC2392 S 2 |
|
3742 | 3742 | if (strlen($basedir) > 1 and '/' != substr($basedir, -1)) { |
3743 | 3743 | $basedir .= '/'; |
3744 | 3744 | } |
@@ -3746,7 +3746,7 @@ discard block |
||
3746 | 3746 | $directory .= '/'; |
3747 | 3747 | } |
3748 | 3748 | if ($this->addEmbeddedImage( |
3749 | - $basedir . $directory . $filename, |
|
3749 | + $basedir.$directory.$filename, |
|
3750 | 3750 | $cid, |
3751 | 3751 | $filename, |
3752 | 3752 | 'base64', |
@@ -3754,8 +3754,8 @@ discard block |
||
3754 | 3754 | ) |
3755 | 3755 | ) { |
3756 | 3756 | $message = preg_replace( |
3757 | - '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', |
|
3758 | - $images[1][$imgindex] . '="cid:' . $cid . '"', |
|
3757 | + '/'.$images[1][$imgindex].'=["\']'.preg_quote($url, '/').'["\']/Ui', |
|
3758 | + $images[1][$imgindex].'="cid:'.$cid.'"', |
|
3759 | 3759 | $message |
3760 | 3760 | ); |
3761 | 3761 | } |
@@ -4029,7 +4029,7 @@ discard block |
||
4029 | 4029 | |
4030 | 4030 | return true; |
4031 | 4031 | } |
4032 | - $this->setError($this->lang('variable_set') . $name); |
|
4032 | + $this->setError($this->lang('variable_set').$name); |
|
4033 | 4033 | |
4034 | 4034 | return false; |
4035 | 4035 | } |
@@ -4123,7 +4123,7 @@ discard block |
||
4123 | 4123 | if (((0x21 <= $ord) and ($ord <= 0x3A)) or $ord == 0x3C or ((0x3E <= $ord) and ($ord <= 0x7E))) { |
4124 | 4124 | $line .= $txt[$i]; |
4125 | 4125 | } else { |
4126 | - $line .= '=' . sprintf('%02X', $ord); |
|
4126 | + $line .= '='.sprintf('%02X', $ord); |
|
4127 | 4127 | } |
4128 | 4128 | } |
4129 | 4129 | |
@@ -4143,14 +4143,13 @@ discard block |
||
4143 | 4143 | { |
4144 | 4144 | if (!defined('PKCS7_TEXT')) { |
4145 | 4145 | if ($this->exceptions) { |
4146 | - throw new Exception($this->lang('extension_missing') . 'openssl'); |
|
4146 | + throw new Exception($this->lang('extension_missing').'openssl'); |
|
4147 | 4147 | } |
4148 | 4148 | |
4149 | 4149 | return ''; |
4150 | 4150 | } |
4151 | 4151 | $privKeyStr = !empty($this->DKIM_private_string) ? |
4152 | - $this->DKIM_private_string : |
|
4153 | - file_get_contents($this->DKIM_private); |
|
4152 | + $this->DKIM_private_string : file_get_contents($this->DKIM_private); |
|
4154 | 4153 | if ('' != $this->DKIM_passphrase) { |
4155 | 4154 | $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); |
4156 | 4155 | } else { |
@@ -4202,7 +4201,7 @@ discard block |
||
4202 | 4201 | //But then says to delete space before and after the colon. |
4203 | 4202 | //Net result is the same as trimming both ends of the value. |
4204 | 4203 | //by elimination, the same applies to the field name |
4205 | - $lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t"); |
|
4204 | + $lines[$key] = trim($heading, " \t").':'.trim($value, " \t"); |
|
4206 | 4205 | } |
4207 | 4206 | |
4208 | 4207 | return implode("\r\n", $lines); |
@@ -4228,7 +4227,7 @@ discard block |
||
4228 | 4227 | $body = static::normalizeBreaks($body, "\r\n"); |
4229 | 4228 | |
4230 | 4229 | //Reduce multiple trailing line breaks to a single one |
4231 | - return rtrim($body, "\r\n") . "\r\n"; |
|
4230 | + return rtrim($body, "\r\n")."\r\n"; |
|
4232 | 4231 | } |
4233 | 4232 | |
4234 | 4233 | /** |
@@ -4284,33 +4283,33 @@ discard block |
||
4284 | 4283 | if ('' == $this->DKIM_identity) { |
4285 | 4284 | $ident = ''; |
4286 | 4285 | } else { |
4287 | - $ident = ' i=' . $this->DKIM_identity . ';'; |
|
4288 | - } |
|
4289 | - $dkimhdrs = 'DKIM-Signature: v=1; a=' . |
|
4290 | - $DKIMsignatureType . '; q=' . |
|
4291 | - $DKIMquery . '; l=' . |
|
4292 | - $DKIMlen . '; s=' . |
|
4293 | - $this->DKIM_selector . |
|
4294 | - ";\r\n" . |
|
4295 | - "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . |
|
4296 | - "\th=From:To:Date:Subject;\r\n" . |
|
4297 | - "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . |
|
4298 | - "\tz=$from\r\n" . |
|
4299 | - "\t|$to\r\n" . |
|
4300 | - "\t|$date\r\n" . |
|
4301 | - "\t|$subject;\r\n" . |
|
4302 | - "\tbh=" . $DKIMb64 . ";\r\n" . |
|
4286 | + $ident = ' i='.$this->DKIM_identity.';'; |
|
4287 | + } |
|
4288 | + $dkimhdrs = 'DKIM-Signature: v=1; a='. |
|
4289 | + $DKIMsignatureType.'; q='. |
|
4290 | + $DKIMquery.'; l='. |
|
4291 | + $DKIMlen.'; s='. |
|
4292 | + $this->DKIM_selector. |
|
4293 | + ";\r\n". |
|
4294 | + "\tt=".$DKIMtime.'; c='.$DKIMcanonicalization.";\r\n". |
|
4295 | + "\th=From:To:Date:Subject;\r\n". |
|
4296 | + "\td=".$this->DKIM_domain.';'.$ident."\r\n". |
|
4297 | + "\tz=$from\r\n". |
|
4298 | + "\t|$to\r\n". |
|
4299 | + "\t|$date\r\n". |
|
4300 | + "\t|$subject;\r\n". |
|
4301 | + "\tbh=".$DKIMb64.";\r\n". |
|
4303 | 4302 | "\tb="; |
4304 | 4303 | $toSign = $this->DKIM_HeaderC( |
4305 | - $from_header . "\r\n" . |
|
4306 | - $to_header . "\r\n" . |
|
4307 | - $date_header . "\r\n" . |
|
4308 | - $subject_header . "\r\n" . |
|
4304 | + $from_header."\r\n". |
|
4305 | + $to_header."\r\n". |
|
4306 | + $date_header."\r\n". |
|
4307 | + $subject_header."\r\n". |
|
4309 | 4308 | $dkimhdrs |
4310 | 4309 | ); |
4311 | 4310 | $signed = $this->DKIM_Sign($toSign); |
4312 | 4311 | |
4313 | - return static::normalizeBreaks($dkimhdrs . $signed) . static::$LE; |
|
4312 | + return static::normalizeBreaks($dkimhdrs.$signed).static::$LE; |
|
4314 | 4313 | } |
4315 | 4314 | |
4316 | 4315 | /** |
@@ -4323,7 +4322,7 @@ discard block |
||
4323 | 4322 | */ |
4324 | 4323 | public static function hasLineLongerThanMax($str) |
4325 | 4324 | { |
4326 | - return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str); |
|
4325 | + return (bool) preg_match('/^(.{'.(self::MAX_LINE_LENGTH + strlen(static::$LE)).',})/m', $str); |
|
4327 | 4326 | } |
4328 | 4327 | |
4329 | 4328 | /** |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | // Connect to the SMTP server |
309 | 309 | $this->edebug( |
310 | - "Connection: opening to $host:$port, timeout=$timeout, options=" . |
|
310 | + "Connection: opening to $host:$port, timeout=$timeout, options=". |
|
311 | 311 | (count($options) > 0 ? var_export($options, true) : 'array()'), |
312 | 312 | self::DEBUG_CONNECTION |
313 | 313 | ); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $socket_context = stream_context_create($options); |
318 | 318 | set_error_handler(array($this, 'errorHandler')); |
319 | 319 | $this->smtp_conn = stream_socket_client( |
320 | - $host . ':' . $port, |
|
320 | + $host.':'.$port, |
|
321 | 321 | $errno, |
322 | 322 | $errstr, |
323 | 323 | $timeout, |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | (string) $errstr |
351 | 351 | ); |
352 | 352 | $this->edebug( |
353 | - 'SMTP ERROR: ' . $this->error['error'] |
|
353 | + 'SMTP ERROR: '.$this->error['error'] |
|
354 | 354 | . ": $errstr ($errno)", |
355 | 355 | self::DEBUG_CLIENT |
356 | 356 | ); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | } |
371 | 371 | // Get any announcement |
372 | 372 | $announce = $this->get_lines(); |
373 | - $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); |
|
373 | + $this->edebug('SERVER -> CLIENT: '.$announce, self::DEBUG_SERVER); |
|
374 | 374 | |
375 | 375 | return true; |
376 | 376 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $password, |
427 | 427 | $authtype = null, |
428 | 428 | $OAuth = null |
429 | - ) { |
|
429 | + ){ |
|
430 | 430 | if (!$this->server_caps) { |
431 | 431 | $this->setError('Authentication is not allowed before HELO/EHLO'); |
432 | 432 | |
@@ -443,15 +443,15 @@ discard block |
||
443 | 443 | return false; |
444 | 444 | } |
445 | 445 | |
446 | - $this->edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); |
|
446 | + $this->edebug('Auth method requested: '.($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); |
|
447 | 447 | $this->edebug( |
448 | - 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), |
|
448 | + 'Auth methods available on the server: '.implode(',', $this->server_caps['AUTH']), |
|
449 | 449 | self::DEBUG_LOWLEVEL |
450 | 450 | ); |
451 | 451 | |
452 | 452 | //If we have requested a specific auth type, check the server supports it before trying others |
453 | 453 | if (!in_array($authtype, $this->server_caps['AUTH'])) { |
454 | - $this->edebug('Requested auth method not available: ' . $authtype, self::DEBUG_LOWLEVEL); |
|
454 | + $this->edebug('Requested auth method not available: '.$authtype, self::DEBUG_LOWLEVEL); |
|
455 | 455 | $authtype = null; |
456 | 456 | } |
457 | 457 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | return false; |
471 | 471 | } |
472 | - self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL); |
|
472 | + self::edebug('Auth method selected: '.$authtype, self::DEBUG_LOWLEVEL); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | if (!in_array($authtype, $this->server_caps['AUTH'])) { |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | // Send encoded username and password |
490 | 490 | if (!$this->sendCommand( |
491 | 491 | 'User & Password', |
492 | - base64_encode("\0" . $username . "\0" . $password), |
|
492 | + base64_encode("\0".$username."\0".$password), |
|
493 | 493 | 235 |
494 | 494 | ) |
495 | 495 | ) { |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $challenge = base64_decode(substr($this->last_reply, 4)); |
518 | 518 | |
519 | 519 | // Build the response |
520 | - $response = $username . ' ' . $this->hmac($challenge, $password); |
|
520 | + $response = $username.' '.$this->hmac($challenge, $password); |
|
521 | 521 | |
522 | 522 | // send encoded credentials |
523 | 523 | return $this->sendCommand('Username', base64_encode($response), 235); |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | $oauth = $OAuth->getOauth64(); |
530 | 530 | |
531 | 531 | // Start authentication |
532 | - if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { |
|
532 | + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 '.$oauth, 235)) { |
|
533 | 533 | return false; |
534 | 534 | } |
535 | 535 | break; |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | $k_ipad = $key ^ $ipad; |
577 | 577 | $k_opad = $key ^ $opad; |
578 | 578 | |
579 | - return md5($k_opad . pack('H*', md5($k_ipad . $data))); |
|
579 | + return md5($k_opad.pack('H*', md5($k_ipad.$data))); |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | /** |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | } |
692 | 692 | //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 |
693 | 693 | if ($in_headers) { |
694 | - $line = "\t" . $line; |
|
694 | + $line = "\t".$line; |
|
695 | 695 | } |
696 | 696 | } |
697 | 697 | $lines_out[] = $line; |
@@ -700,9 +700,9 @@ discard block |
||
700 | 700 | foreach ($lines_out as $line_out) { |
701 | 701 | //RFC2821 section 4.5.2 |
702 | 702 | if (!empty($line_out) and $line_out[0] == '.') { |
703 | - $line_out = '.' . $line_out; |
|
703 | + $line_out = '.'.$line_out; |
|
704 | 704 | } |
705 | - $this->client_send($line_out . static::LE, 'DATA'); |
|
705 | + $this->client_send($line_out.static::LE, 'DATA'); |
|
706 | 706 | } |
707 | 707 | } |
708 | 708 | |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | */ |
749 | 749 | protected function sendHello($hello, $host) |
750 | 750 | { |
751 | - $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); |
|
751 | + $noerror = $this->sendCommand($hello, $hello.' '.$host, 250); |
|
752 | 752 | $this->helo_rply = $this->last_reply; |
753 | 753 | if ($noerror) { |
754 | 754 | $this->parseHelloFields($hello); |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | |
820 | 820 | return $this->sendCommand( |
821 | 821 | 'MAIL FROM', |
822 | - 'MAIL FROM:<' . $from . '>' . $useVerp, |
|
822 | + 'MAIL FROM:<'.$from.'>'.$useVerp, |
|
823 | 823 | 250 |
824 | 824 | ); |
825 | 825 | } |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | { |
860 | 860 | return $this->sendCommand( |
861 | 861 | 'RCPT TO', |
862 | - 'RCPT TO:<' . $address . '>', |
|
862 | + 'RCPT TO:<'.$address.'>', |
|
863 | 863 | array(250, 251) |
864 | 864 | ); |
865 | 865 | } |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | |
899 | 899 | return false; |
900 | 900 | } |
901 | - $this->client_send($commandstring . static::LE, $command); |
|
901 | + $this->client_send($commandstring.static::LE, $command); |
|
902 | 902 | |
903 | 903 | $this->last_reply = $this->get_lines(); |
904 | 904 | // Fetch SMTP code and possible error code explanation |
@@ -908,8 +908,8 @@ discard block |
||
908 | 908 | $code_ex = (count($matches) > 2 ? $matches[2] : null); |
909 | 909 | // Cut off error code from each response line |
910 | 910 | $detail = preg_replace( |
911 | - "/{$code}[ -]" . |
|
912 | - ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m', |
|
911 | + "/{$code}[ -]". |
|
912 | + ($code_ex ? str_replace('.', '\\.', $code_ex).' ' : '').'/m', |
|
913 | 913 | '', |
914 | 914 | $this->last_reply |
915 | 915 | ); |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | $detail = substr($this->last_reply, 4); |
921 | 921 | } |
922 | 922 | |
923 | - $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); |
|
923 | + $this->edebug('SERVER -> CLIENT: '.$this->last_reply, self::DEBUG_SERVER); |
|
924 | 924 | |
925 | 925 | if (!in_array($code, (array) $expect)) { |
926 | 926 | $this->setError( |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | $code_ex |
931 | 931 | ); |
932 | 932 | $this->edebug( |
933 | - 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, |
|
933 | + 'SMTP ERROR: '.$this->error['error'].': '.$this->last_reply, |
|
934 | 934 | self::DEBUG_CLIENT |
935 | 935 | ); |
936 | 936 | |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | public function turn() |
997 | 997 | { |
998 | 998 | $this->setError('The SMTP TURN command is not implemented'); |
999 | - $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); |
|
999 | + $this->edebug('SMTP NOTICE: '.$this->error['error'], self::DEBUG_CLIENT); |
|
1000 | 1000 | |
1001 | 1001 | return false; |
1002 | 1002 | } |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | in_array($command, array('User & Password', 'Username', 'Password'), true)) { |
1018 | 1018 | $this->edebug('CLIENT -> SERVER: <credentials hidden>', self::DEBUG_CLIENT); |
1019 | 1019 | } else { |
1020 | - $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); |
|
1020 | + $this->edebug('CLIENT -> SERVER: '.$data, self::DEBUG_CLIENT); |
|
1021 | 1021 | } |
1022 | 1022 | set_error_handler(array($this, 'errorHandler')); |
1023 | 1023 | $result = fwrite($this->smtp_conn, $data); |
@@ -1123,14 +1123,14 @@ discard block |
||
1123 | 1123 | //Must pass vars in here as params are by reference |
1124 | 1124 | if (!stream_select($selR, $selW, $selW, $this->Timelimit)) { |
1125 | 1125 | $this->edebug( |
1126 | - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', |
|
1126 | + 'SMTP -> get_lines(): timed-out ('.$this->Timeout.' sec)', |
|
1127 | 1127 | self::DEBUG_LOWLEVEL |
1128 | 1128 | ); |
1129 | 1129 | break; |
1130 | 1130 | } |
1131 | 1131 | //Deliberate noise suppression - errors are handled afterwards |
1132 | 1132 | $str = @fgets($this->smtp_conn, 515); |
1133 | - $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL); |
|
1133 | + $this->edebug('SMTP INBOUND: "'.trim($str).'"', self::DEBUG_LOWLEVEL); |
|
1134 | 1134 | $data .= $str; |
1135 | 1135 | // If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), |
1136 | 1136 | // or 4th character is a space, we are done reading, break the loop, |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | $info = stream_get_meta_data($this->smtp_conn); |
1143 | 1143 | if ($info['timed_out']) { |
1144 | 1144 | $this->edebug( |
1145 | - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', |
|
1145 | + 'SMTP -> get_lines(): timed-out ('.$this->Timeout.' sec)', |
|
1146 | 1146 | self::DEBUG_LOWLEVEL |
1147 | 1147 | ); |
1148 | 1148 | break; |
@@ -1150,8 +1150,8 @@ discard block |
||
1150 | 1150 | // Now check if reads took too long |
1151 | 1151 | if ($endtime and time() > $endtime) { |
1152 | 1152 | $this->edebug( |
1153 | - 'SMTP -> get_lines(): timelimit reached (' . |
|
1154 | - $this->Timelimit . ' sec)', |
|
1153 | + 'SMTP -> get_lines(): timelimit reached ('. |
|
1154 | + $this->Timelimit.' sec)', |
|
1155 | 1155 | self::DEBUG_LOWLEVEL |
1156 | 1156 | ); |
1157 | 1157 | break; |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | protected function sendCommand($command, $commandstring, $expect) |
889 | 889 | { |
890 | 890 | if (!$this->connected()) { |
891 | - $this->setError("Called $command without being connected"); |
|
891 | + $this->setError("called $command without being connected"); |
|
892 | 892 | |
893 | 893 | return false; |
894 | 894 | } |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | */ |
971 | 971 | public function verify($name) |
972 | 972 | { |
973 | - return $this->sendCommand('VRFY', "VRFY $name", array(250, 251)); |
|
973 | + return $this->sendCommand('VRFY', "vrfy $name", array(250, 251)); |
|
974 | 974 | } |
975 | 975 | |
976 | 976 | /** |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | $ContextMenuCnt++; |
26 | 26 | $this->html = ""; |
27 | 27 | $this->visible = $visible ? $visible : false; |
28 | - $this->width = is_numeric($width) ? (int)$width : 120; |
|
29 | - $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
|
28 | + $this->width = is_numeric($width) ? (int) $width : 120; |
|
29 | + $this->id = $id ? $id : "cntxMnu".$ContextMenuCnt; // set id |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function addItem($text, $action = "", $img = "", $disabled = 0) |
@@ -36,23 +36,23 @@ discard block |
||
36 | 36 | return; |
37 | 37 | } |
38 | 38 | if (!$img) { |
39 | - $img = $base_url . $_style['tx']; |
|
39 | + $img = $base_url.$_style['tx']; |
|
40 | 40 | } |
41 | 41 | if (substr($action, 0, 3) == "js:") { |
42 | 42 | $action = substr($action, 3); |
43 | 43 | } elseif (substr($action, 0, 3) == "hl:") { |
44 | - $action = "window.location.href='" . substr($action, 3) . "'"; |
|
44 | + $action = "window.location.href='".substr($action, 3)."'"; |
|
45 | 45 | } else { |
46 | - $action = "window.location.href='" . $action . "'"; |
|
46 | + $action = "window.location.href='".$action."'"; |
|
47 | 47 | } |
48 | - $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\""; |
|
49 | - $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>"; |
|
48 | + $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('".$this->id."');\""; |
|
49 | + $this->html .= "<div class='".($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem")."' $action>"; |
|
50 | 50 | if (substr($img, 0, 5) == 'fa fa') { |
51 | - $img = '<i class="' . $img . '"></i>'; |
|
51 | + $img = '<i class="'.$img.'"></i>'; |
|
52 | 52 | } elseif (substr($img, 0, 1) != '<') { |
53 | - $img = '<img src="' . $img . '" />'; |
|
53 | + $img = '<img src="'.$img.'" />'; |
|
54 | 54 | } |
55 | - $this->html .= $img . ' ' . $text . '</div>'; |
|
55 | + $this->html .= $img.' '.$text.'</div>'; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public function addSeparator() |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | { |
67 | 67 | global $ContextMenuScript; |
68 | 68 | |
69 | - $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
|
69 | + $html = $ContextMenuScript."<div id='".$this->id."' class='contextMenu' style='width:".$this->width."px; visibility:".($this->visible ? 'visible' : 'hidden')."'>".$this->html."</div>"; |
|
70 | 70 | $ContextMenuScript = ""; // reset css |
71 | 71 | return $html; |
72 | 72 | } |
73 | 73 | |
74 | 74 | public function getClientScriptObject() |
75 | 75 | { |
76 | - return "getCntxMenu('" . $this->id . "')"; |
|
76 | + return "getCntxMenu('".$this->id."')"; |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -$lockElementId = (int)$lockElementId; |
|
6 | +$lockElementId = (int) $lockElementId; |
|
7 | 7 | |
8 | 8 | if ($lockElementId > 0) { |
9 | 9 | ?> |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
67 | 67 | |
68 | -if ($modx_charset == 'euc-jp') { |
|
68 | +if ($modx_charset == 'euc-jp') { |
|
69 | 69 | $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
70 | 70 | } elseif ($modx_charset == 'shift_jis') { |
71 | 71 | $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $tpl = '<option value="%s" %s>%s</option>'; |
101 | 101 | $options = array(); |
102 | 102 | foreach ($_ as $value=>$label) { |
103 | - $selected = $value===$modx_charset ? 'selected' : ''; |
|
103 | + $selected = $value === $modx_charset ? 'selected' : ''; |
|
104 | 104 | $options[] = sprintf($tpl, $value, $selected, $label); |
105 | 105 | } |
106 | 106 | echo implode("\n", $options); |