@@ -1,2 +1,2 @@ |
||
1 | 1 | <?php |
2 | -return preg_replace_callback("~(\b\w+\b)~",function($m) use($wrapat) {return wordwrap($m[1],$wrapat,' ',1);},$value); |
|
2 | +return preg_replace_callback("~(\b\w+\b)~", function($m) use($wrapat) {return wordwrap($m[1], $wrapat, ' ', 1); },$value); |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | $text = $modx->filter->parseDocumentSource($value); |
3 | -$text = str_replace(array("\r\n","\r"),"\n",$text); |
|
3 | +$text = str_replace(array("\r\n", "\r"), "\n", $text); |
|
4 | 4 | |
5 | 5 | $blockElms = 'br,table,tbody,tr,td,th,thead,tfoot,caption,colgroup,div'; |
6 | 6 | $blockElms .= ',dl,dd,dt,ul,ol,li,pre,select,option,form,map,area,blockquote'; |
7 | 7 | $blockElms .= ',address,math,style,input,p,h1,h2,h3,h4,h5,h6,hr,object,param,embed'; |
8 | 8 | $blockElms .= ',noframes,noscript,section,article,aside,hgroup,footer,address,code'; |
9 | 9 | $blockElms = explode(',', $blockElms); |
10 | -$lines = explode("\n",$text); |
|
10 | +$lines = explode("\n", $text); |
|
11 | 11 | $c = count($lines); |
12 | -foreach($lines as $i=>$line) |
|
12 | +foreach ($lines as $i=>$line) |
|
13 | 13 | { |
14 | 14 | $line = rtrim($line); |
15 | - if($i===$c-1) break; |
|
16 | - foreach($blockElms as $block) |
|
15 | + if ($i === $c - 1) break; |
|
16 | + foreach ($blockElms as $block) |
|
17 | 17 | { |
18 | - if(preg_match("@</?{$block}" . '[^>]*>$@',$line)) |
|
18 | + if (preg_match("@</?{$block}".'[^>]*>$@', $line)) |
|
19 | 19 | continue 2; |
20 | 20 | } |
21 | 21 | $lines[$i] = "{$line}<br />"; |
@@ -1,43 +1,43 @@ |
||
1 | 1 | <?php |
2 | -if(strpos($opt,',')) list($limit,$delim) = explode(',', $opt); |
|
3 | -elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';} |
|
4 | -else {$limit=124;$delim='';} |
|
2 | +if (strpos($opt, ',')) list($limit, $delim) = explode(',', $opt); |
|
3 | +elseif (preg_match('/^[1-9][0-9]*$/', $opt)) {$limit = $opt; $delim = ''; } |
|
4 | +else {$limit = 124; $delim = ''; } |
|
5 | 5 | |
6 | -if($delim==='') $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.'; |
|
6 | +if ($delim === '') $delim = $modx->config['manager_language'] === 'japanese-utf8' ? '。' : '.'; |
|
7 | 7 | $limit = intval($limit); |
8 | 8 | |
9 | 9 | $content = $modx->filter->parseDocumentSource($value); |
10 | 10 | |
11 | 11 | $content = strip_tags($content); |
12 | 12 | |
13 | -$content = str_replace(array("\r\n","\r","\n","\t",' '),' ',$content); |
|
14 | -if(preg_match('/\s+/',$content)) |
|
15 | - $content = preg_replace('/\s+/',' ',$content); |
|
13 | +$content = str_replace(array("\r\n", "\r", "\n", "\t", ' '), ' ', $content); |
|
14 | +if (preg_match('/\s+/', $content)) |
|
15 | + $content = preg_replace('/\s+/', ' ', $content); |
|
16 | 16 | $content = trim($content); |
17 | 17 | |
18 | 18 | $pos = $modx->filter->strpos($content, $delim); |
19 | 19 | |
20 | -if($pos!==false && $pos<$limit) { |
|
20 | +if ($pos !== false && $pos < $limit) { |
|
21 | 21 | $_ = explode($delim, $content); |
22 | 22 | $text = ''; |
23 | - foreach($_ as $v) { |
|
24 | - if($limit <= $modx->filter->strlen($text.$v.$delim)) break; |
|
23 | + foreach ($_ as $v) { |
|
24 | + if ($limit <= $modx->filter->strlen($text.$v.$delim)) break; |
|
25 | 25 | $text .= $v.$delim; |
26 | 26 | } |
27 | - if($text) $content = $text; |
|
27 | + if ($text) $content = $text; |
|
28 | 28 | } |
29 | 29 | |
30 | -if($limit<$modx->filter->strlen($content) && strpos($content,' ')!==false) { |
|
30 | +if ($limit < $modx->filter->strlen($content) && strpos($content, ' ') !== false) { |
|
31 | 31 | $_ = explode(' ', $content); |
32 | 32 | $text = ''; |
33 | - foreach($_ as $v) { |
|
34 | - if($limit <= $modx->filter->strlen($text.$v.' ')) break; |
|
35 | - $text .= $v . ' '; |
|
33 | + foreach ($_ as $v) { |
|
34 | + if ($limit <= $modx->filter->strlen($text.$v.' ')) break; |
|
35 | + $text .= $v.' '; |
|
36 | 36 | } |
37 | - if($text!=='') $content = $text; |
|
37 | + if ($text !== '') $content = $text; |
|
38 | 38 | } |
39 | 39 | |
40 | -if($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit); |
|
41 | -if($modx->filter->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim; |
|
40 | +if ($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit); |
|
41 | +if ($modx->filter->substr($content, -1) == $delim) $content = rtrim($content, $delim).$delim; |
|
42 | 42 | |
43 | 43 | return $content; |
@@ -2,22 +2,22 @@ |
||
2 | 2 | $userID = abs($modx->getLoginUserID('web')); |
3 | 3 | $modx->qs_hash = md5($modx->qs_hash."^{$userID}^"); |
4 | 4 | |
5 | -$groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array(); |
|
5 | +$groupNames = ($this->strlen($opt) > 0) ? explode(',', $opt) : array(); |
|
6 | 6 | |
7 | 7 | // if $groupNames is not an array return false |
8 | -if(!is_array($groupNames)) return 0; |
|
8 | +if (!is_array($groupNames)) return 0; |
|
9 | 9 | |
10 | 10 | // Creates an array with all webgroups the user id is in |
11 | 11 | if (isset($modx->filter->cache['mo'][$userID])) $grpNames = $modx->filter->cache['mo'][$userID]; |
12 | 12 | else { |
13 | - $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",$userID); |
|
14 | - $rs = $modx->db->select('wgn.name',$from); |
|
15 | - $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name',$rs); |
|
13 | + $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'", $userID); |
|
14 | + $rs = $modx->db->select('wgn.name', $from); |
|
15 | + $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name', $rs); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | // Check if a supplied group matches a webgroup from the array we just created |
19 | -foreach($groupNames as $k=>$v) { |
|
20 | - if(in_array(trim($v),$grpNames)) return 1; |
|
19 | +foreach ($groupNames as $k=>$v) { |
|
20 | + if (in_array(trim($v), $grpNames)) return 1; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | // If we get here the above logic did not find a match, so return false |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Message Quit Template |
4 | 4 | * |
5 | 5 | */ |
6 | -if(IN_MANAGER_MODE!="true" && IN_PARSER_MODE!="true") die("<b>INCLUDE ACCESS ERROR</b><br /><br />Direct access to this file prohibited."); |
|
6 | +if (IN_MANAGER_MODE != "true" && IN_PARSER_MODE != "true") die("<b>INCLUDE ACCESS ERROR</b><br /><br />Direct access to this file prohibited."); |
|
7 | 7 | |
8 | 8 | $parsedMessageString = " |
9 | 9 | <html><head><title>EVO Content Manager $version » $release_date</title> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | </script> |
19 | 19 | </head><body> |
20 | 20 | "; |
21 | -if($is_error) { |
|
21 | +if ($is_error) { |
|
22 | 22 | $parsedMessageString .= "<h3 style='color:red;background:#e0e0e0;padding:2px;'> MODX Parse Error </h3> |
23 | 23 | <table border='0' cellpadding='1' cellspacing='0'> |
24 | 24 | <tr><td colspan='3'>MODX encountered the following error while attempting to parse the requested resource:</td></tr> |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | <tr><td colspan='3'><b style='color:#003399;'>« $msg »</b></td></tr>"; |
31 | 31 | } |
32 | 32 | |
33 | -if(!empty($query)) { |
|
33 | +if (!empty($query)) { |
|
34 | 34 | $parsedMessageString .= "<tr><td colspan='3'><hr size='1' width='98%' style='color:#e0e0e0'/><b style='color:#999;font-size: 9px;border-left:1px solid #c0c0c0; margin-left:10px;'> SQL: <span id='sqlHolder'>$query</span></b><hr size='1' width='98%' style='color:#e0e0e0'/> |
35 | 35 | <a href='javascript:copyToClip();' style='color:#821517;font-size: 9px; text-decoration: none'>[Copy SQL to ClipBoard]</a><textarea id='holdtext' style='display:none;'></textarea></td></tr>"; |
36 | 36 | } |
37 | 37 | |
38 | -if($text!='') { |
|
38 | +if ($text != '') { |
|
39 | 39 | |
40 | - $errortype = array ( |
|
40 | + $errortype = array( |
|
41 | 41 | E_ERROR => "Error", |
42 | 42 | E_WARNING => "Warning", |
43 | 43 | E_PARSE => "Parsing Error", |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $parsedMessageString .= "<tr><td> Line: </td>"; |
69 | 69 | $parsedMessageString .= "<td colspan='2'>$line</td><td> </td>"; |
70 | 70 | $parsedMessageString .= "</tr>"; |
71 | - if($source!='') { |
|
71 | + if ($source != '') { |
|
72 | 72 | $parsedMessageString .= "<tr><td valign='top'> Line $line source: </td>"; |
73 | 73 | $parsedMessageString .= "<td colspan='2'>$source</td><td> </td>"; |
74 | 74 | $parsedMessageString .= "</tr>"; |
@@ -5,13 +5,13 @@ |
||
5 | 5 | * Time: 12:25 |
6 | 6 | */ |
7 | 7 | |
8 | -if (isset($this->phpcompat) && is_object($this->phpcompat)){ |
|
8 | +if (isset($this->phpcompat) && is_object($this->phpcompat)) { |
|
9 | 9 | return true; |
10 | 10 | } |
11 | 11 | |
12 | -if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')){ |
|
12 | +if (!include_once(MODX_MANAGER_PATH.'includes/extenders/phpcompat.class.inc.php')) { |
|
13 | 13 | return false; |
14 | -}else{ |
|
14 | +} else { |
|
15 | 15 | $this->phpcompat = new PHPCOMPAT; |
16 | 16 | return true; |
17 | 17 | } |
@@ -5,13 +5,13 @@ |
||
5 | 5 | * Time: 19:14 |
6 | 6 | */ |
7 | 7 | |
8 | -if (isset($this->phpass) && is_object($this->phpass)){ |
|
8 | +if (isset($this->phpass) && is_object($this->phpass)) { |
|
9 | 9 | return true; |
10 | 10 | } |
11 | 11 | |
12 | -if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')){ |
|
12 | +if (!include_once(MODX_MANAGER_PATH.'includes/extenders/phpass.class.inc.php')) { |
|
13 | 13 | return false; |
14 | -}else{ |
|
14 | +} else { |
|
15 | 15 | $this->phpass = new PasswordHash; |
16 | 16 | return true; |
17 | 17 | } |
18 | 18 | \ No newline at end of file |
@@ -1,43 +1,43 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $this->old = new OldFunctions(); |
3 | -class OldFunctions { |
|
3 | +class OldFunctions{ |
|
4 | 4 | |
5 | - function dbConnect() {global $modx; $modx->db->connect();$modx->rs = $modx->db->conn;} |
|
6 | - function dbQuery($sql) {global $modx;return $modx->db->query($sql);} |
|
7 | - function recordCount($rs) {global $modx;return $modx->db->getRecordCount($rs);} |
|
8 | - function fetchRow($rs,$mode='assoc') {global $modx;return $modx->db->getRow($rs, $mode);} |
|
9 | - function affectedRows($rs) {global $modx;return $modx->db->getAffectedRows($rs);} |
|
10 | - function insertId($rs) {global $modx;return $modx->db->getInsertId($rs);} |
|
11 | - function dbClose() {global $modx; $modx->db->disconnect();} |
|
5 | + function dbConnect(){global $modx; $modx->db->connect(); $modx->rs = $modx->db->conn; } |
|
6 | + function dbQuery($sql){global $modx; return $modx->db->query($sql); } |
|
7 | + function recordCount($rs){global $modx; return $modx->db->getRecordCount($rs); } |
|
8 | + function fetchRow($rs, $mode = 'assoc'){global $modx; return $modx->db->getRow($rs, $mode); } |
|
9 | + function affectedRows($rs){global $modx; return $modx->db->getAffectedRows($rs); } |
|
10 | + function insertId($rs){global $modx; return $modx->db->getInsertId($rs); } |
|
11 | + function dbClose(){global $modx; $modx->db->disconnect(); } |
|
12 | 12 | |
13 | - function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) { |
|
13 | + function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = '', $ordered = false, $tablevel = 0){ |
|
14 | 14 | // first find out whether the value passed is an array |
15 | 15 | if (!is_array($array)) { |
16 | 16 | return "<ul><li>Bad list</li></ul>"; |
17 | 17 | } |
18 | 18 | if (!empty ($type)) { |
19 | - $typestr= " style='list-style-type: $type'"; |
|
19 | + $typestr = " style='list-style-type: $type'"; |
|
20 | 20 | } else { |
21 | - $typestr= ""; |
|
21 | + $typestr = ""; |
|
22 | 22 | } |
23 | - $tabs= ""; |
|
24 | - for ($i= 0; $i < $tablevel; $i++) { |
|
23 | + $tabs = ""; |
|
24 | + for ($i = 0; $i < $tablevel; $i++) { |
|
25 | 25 | $tabs .= "\t"; |
26 | 26 | } |
27 | - $listhtml= $ordered == true ? $tabs . "<ol class='$ulroot'$typestr>\n" : $tabs . "<ul class='$ulroot'$typestr>\n"; |
|
27 | + $listhtml = $ordered == true ? $tabs."<ol class='$ulroot'$typestr>\n" : $tabs."<ul class='$ulroot'$typestr>\n"; |
|
28 | 28 | foreach ($array as $key => $value) { |
29 | 29 | if (is_array($value)) { |
30 | - $listhtml .= $tabs . "\t<li>" . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix, $type, $ordered, $tablevel +2) . $tabs . "\t</li>\n"; |
|
30 | + $listhtml .= $tabs."\t<li>".$key."\n".$this->makeList($value, $ulprefix.$ulroot, $ulprefix, $type, $ordered, $tablevel + 2).$tabs."\t</li>\n"; |
|
31 | 31 | } else { |
32 | - $listhtml .= $tabs . "\t<li>" . $value . "</li>\n"; |
|
32 | + $listhtml .= $tabs."\t<li>".$value."</li>\n"; |
|
33 | 33 | } |
34 | 34 | } |
35 | - $listhtml .= $ordered == true ? $tabs . "</ol>\n" : $tabs . "</ul>\n"; |
|
35 | + $listhtml .= $ordered == true ? $tabs."</ol>\n" : $tabs."</ul>\n"; |
|
36 | 36 | return $listhtml; |
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | - function getUserData() { |
|
40 | + function getUserData(){ |
|
41 | 41 | $client['ip'] = $_SERVER['REMOTE_ADDR']; |
42 | 42 | $client['ua'] = $_SERVER['HTTP_USER_AGENT']; |
43 | 43 | return $client; |
@@ -45,80 +45,80 @@ discard block |
||
45 | 45 | |
46 | 46 | # Returns true, install or interact when inside manager |
47 | 47 | // deprecated |
48 | - function insideManager() { |
|
49 | - $m= false; |
|
48 | + function insideManager(){ |
|
49 | + $m = false; |
|
50 | 50 | if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE == 'true') { |
51 | - $m= true; |
|
51 | + $m = true; |
|
52 | 52 | if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true') |
53 | - $m= "interact"; |
|
53 | + $m = "interact"; |
|
54 | 54 | else |
55 | 55 | if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true') |
56 | - $m= "install"; |
|
56 | + $m = "install"; |
|
57 | 57 | } |
58 | 58 | return $m; |
59 | 59 | } |
60 | 60 | |
61 | 61 | // deprecated |
62 | - function putChunk($chunkName) { // alias name >.< |
|
62 | + function putChunk($chunkName){ // alias name >.< |
|
63 | 63 | global $modx; |
64 | 64 | return $modx->getChunk($chunkName); |
65 | 65 | } |
66 | 66 | |
67 | - function getDocGroups() { |
|
67 | + function getDocGroups(){ |
|
68 | 68 | global $modx; |
69 | 69 | return $modx->getUserDocGroups(); |
70 | 70 | } // deprecated |
71 | 71 | |
72 | - function changePassword($o, $n) { |
|
72 | + function changePassword($o, $n){ |
|
73 | 73 | return changeWebUserPassword($o, $n); |
74 | 74 | } // deprecated |
75 | 75 | |
76 | - function userLoggedIn() { |
|
76 | + function userLoggedIn(){ |
|
77 | 77 | global $modx; |
78 | - $userdetails= array (); |
|
78 | + $userdetails = array(); |
|
79 | 79 | if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) { |
80 | 80 | // web user |
81 | - $userdetails['loggedIn']= true; |
|
82 | - $userdetails['id']= $_SESSION['webInternalKey']; |
|
83 | - $userdetails['username']= $_SESSION['webShortname']; |
|
84 | - $userdetails['usertype']= 'web'; // added by Raymond |
|
81 | + $userdetails['loggedIn'] = true; |
|
82 | + $userdetails['id'] = $_SESSION['webInternalKey']; |
|
83 | + $userdetails['username'] = $_SESSION['webShortname']; |
|
84 | + $userdetails['usertype'] = 'web'; // added by Raymond |
|
85 | 85 | return $userdetails; |
86 | 86 | } else |
87 | 87 | if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) { |
88 | 88 | // manager user |
89 | - $userdetails['loggedIn']= true; |
|
90 | - $userdetails['id']= $_SESSION['mgrInternalKey']; |
|
91 | - $userdetails['username']= $_SESSION['mgrShortname']; |
|
92 | - $userdetails['usertype']= 'manager'; // added by Raymond |
|
89 | + $userdetails['loggedIn'] = true; |
|
90 | + $userdetails['id'] = $_SESSION['mgrInternalKey']; |
|
91 | + $userdetails['username'] = $_SESSION['mgrShortname']; |
|
92 | + $userdetails['usertype'] = 'manager'; // added by Raymond |
|
93 | 93 | return $userdetails; |
94 | 94 | } else { |
95 | 95 | return false; |
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | - function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { |
|
99 | + function getFormVars($method = "", $prefix = "", $trim = "", $REQUEST_METHOD){ |
|
100 | 100 | // function to retrieve form results into an associative array |
101 | 101 | global $modx; |
102 | - $results= array (); |
|
103 | - $method= strtoupper($method); |
|
102 | + $results = array(); |
|
103 | + $method = strtoupper($method); |
|
104 | 104 | if ($method == "") |
105 | - $method= $REQUEST_METHOD; |
|
105 | + $method = $REQUEST_METHOD; |
|
106 | 106 | if ($method == "POST") |
107 | - $method= & $_POST; |
|
108 | - elseif ($method == "GET") $method= & $_GET; |
|
107 | + $method = & $_POST; |
|
108 | + elseif ($method == "GET") $method = & $_GET; |
|
109 | 109 | else |
110 | 110 | return false; |
111 | 111 | reset($method); |
112 | 112 | foreach ($method as $key => $value) { |
113 | 113 | if (($prefix != "") && (substr($key, 0, strlen($prefix)) == $prefix)) { |
114 | 114 | if ($trim) { |
115 | - $pieces= explode($prefix, $key, 2); |
|
116 | - $key= $pieces[1]; |
|
117 | - $results[$key]= $value; |
|
115 | + $pieces = explode($prefix, $key, 2); |
|
116 | + $key = $pieces[1]; |
|
117 | + $results[$key] = $value; |
|
118 | 118 | } else |
119 | - $results[$key]= $value; |
|
119 | + $results[$key] = $value; |
|
120 | 120 | } |
121 | - elseif ($prefix == "") $results[$key]= $value; |
|
121 | + elseif ($prefix == "") $results[$key] = $value; |
|
122 | 122 | } |
123 | 123 | return $results; |
124 | 124 | } |
@@ -129,16 +129,16 @@ discard block |
||
129 | 129 | * @param string $msg Message to show |
130 | 130 | * @param string $url URL to redirect to |
131 | 131 | */ |
132 | - function webAlert($msg, $url= "") { |
|
132 | + function webAlert($msg, $url = ""){ |
|
133 | 133 | global $modx; |
134 | - $msg= addslashes($modx->db->escape($msg)); |
|
134 | + $msg = addslashes($modx->db->escape($msg)); |
|
135 | 135 | if (substr(strtolower($url), 0, 11) == "javascript:") { |
136 | - $act= "__WebAlert();"; |
|
137 | - $fnc= "function __WebAlert(){" . substr($url, 11) . "};"; |
|
136 | + $act = "__WebAlert();"; |
|
137 | + $fnc = "function __WebAlert(){".substr($url, 11)."};"; |
|
138 | 138 | } else { |
139 | - $act= ($url ? "window.location.href='" . addslashes($url) . "';" : ""); |
|
139 | + $act = ($url ? "window.location.href='".addslashes($url)."';" : ""); |
|
140 | 140 | } |
141 | - $html= "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>"; |
|
141 | + $html = "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>"; |
|
142 | 142 | if ($modx->isFrontend()) |
143 | 143 | $modx->regClientScript($html); |
144 | 144 | else { |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | use PHPMailer\PHPMailer\PHPMailer; |
12 | 12 | use PHPMailer\PHPMailer\Exception; |
13 | 13 | |
14 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/Exception.php'; |
|
15 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/PHPMailer.php'; |
|
16 | -require MODX_MANAGER_PATH . 'includes/controls/phpmailer/SMTP.php'; |
|
14 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/Exception.php'; |
|
15 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/PHPMailer.php'; |
|
16 | +require MODX_MANAGER_PATH.'includes/controls/phpmailer/SMTP.php'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Class MODxMailer |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function init(\DocumentParser $modx) |
32 | 32 | { |
33 | 33 | $this->modx = $modx; |
34 | - $this->PluginDir = MODX_MANAGER_PATH . 'includes/controls/phpmailer/'; |
|
34 | + $this->PluginDir = MODX_MANAGER_PATH.'includes/controls/phpmailer/'; |
|
35 | 35 | |
36 | 36 | switch ($modx->config['email_method']) { |
37 | 37 | case 'smtp': |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | mb_language($this->mb_language); |
96 | 96 | mb_internal_encoding($modx->config['modx_charset']); |
97 | 97 | } |
98 | - $exconf = MODX_MANAGER_PATH . 'includes/controls/phpmailer/config.inc.php'; |
|
98 | + $exconf = MODX_MANAGER_PATH.'includes/controls/phpmailer/config.inc.php'; |
|
99 | 99 | if (is_file($exconf)) { |
100 | 100 | include($exconf); |
101 | 101 | } |
@@ -163,12 +163,12 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | if ($this->modx->debug) { |
166 | - $debug_info = 'CharSet = ' . $this->CharSet . "\n"; |
|
167 | - $debug_info .= 'Encoding = ' . $this->Encoding . "\n"; |
|
168 | - $debug_info .= 'mb_language = ' . $this->mb_language . "\n"; |
|
169 | - $debug_info .= 'encode_header_method = ' . $this->encode_header_method . "\n"; |
|
166 | + $debug_info = 'CharSet = '.$this->CharSet."\n"; |
|
167 | + $debug_info .= 'Encoding = '.$this->Encoding."\n"; |
|
168 | + $debug_info .= 'mb_language = '.$this->mb_language."\n"; |
|
169 | + $debug_info .= 'encode_header_method = '.$this->encode_header_method."\n"; |
|
170 | 170 | $debug_info .= "send_mode = {$mode}\n"; |
171 | - $debug_info .= 'Subject = ' . $this->Subject . "\n"; |
|
171 | + $debug_info .= 'Subject = '.$this->Subject."\n"; |
|
172 | 172 | $log = "<pre>{$debug_info}\n{$header}\n{$org_body}</pre>"; |
173 | 173 | $this->modx->logEvent(1, 1, $log, 'MODxMailer debug information'); |
174 | 174 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | ini_set('sendmail_from', $old_from); |
229 | 229 | } |
230 | 230 | if (!$rt) { |
231 | - $msg = $this->Lang('instantiate') . "<br />\n"; |
|
231 | + $msg = $this->Lang('instantiate')."<br />\n"; |
|
232 | 232 | $msg .= "{$this->Subject}<br />\n"; |
233 | 233 | $msg .= "{$this->FromName}<{$this->From}><br />\n"; |
234 | 234 | $msg .= mb_convert_encoding($body, $this->modx->config['modx_charset'], $this->CharSet); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function SetError($msg) |
249 | 249 | { |
250 | - $msg .= '<pre>' . print_r(get_object_vars($this), true) . '</pre>'; |
|
250 | + $msg .= '<pre>'.print_r(get_object_vars($this), true).'</pre>'; |
|
251 | 251 | $this->modx->config['send_errormail'] = '0'; |
252 | 252 | $this->modx->logEvent(0, 3, $msg, 'phpmailer'); |
253 | 253 | |
@@ -276,14 +276,14 @@ discard block |
||
276 | 276 | /** |
277 | 277 | * @return string |
278 | 278 | */ |
279 | - public function getMIMEHeader() { |
|
279 | + public function getMIMEHeader(){ |
|
280 | 280 | return $this->MIMEHeader; |
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
284 | 284 | * @return string |
285 | 285 | */ |
286 | - public function getMIMEBody() { |
|
286 | + public function getMIMEBody(){ |
|
287 | 287 | return $this->MIMEBody; |
288 | 288 | } |
289 | 289 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * |
293 | 293 | * @return $this |
294 | 294 | */ |
295 | - public function setMIMEHeader($header = '') { |
|
295 | + public function setMIMEHeader($header = ''){ |
|
296 | 296 | $this->MIMEHeader = $header; |
297 | 297 | |
298 | 298 | return $this; |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * |
304 | 304 | * @return $this |
305 | 305 | */ |
306 | - public function setMIMEBody($body = '') { |
|
306 | + public function setMIMEBody($body = ''){ |
|
307 | 307 | $this->MIMEBody = $body; |
308 | 308 | |
309 | 309 | return $this; |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | * |
315 | 315 | * @return $this |
316 | 316 | */ |
317 | - public function setMailHeader($header = '') { |
|
317 | + public function setMailHeader($header = ''){ |
|
318 | 318 | $this->mailHeader = $header; |
319 | 319 | |
320 | 320 | return $this; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | /** |
324 | 324 | * @return string |
325 | 325 | */ |
326 | - public function getMessageID() { |
|
327 | - return trim($this->lastMessageID,'<>'); |
|
326 | + public function getMessageID(){ |
|
327 | + return trim($this->lastMessageID, '<>'); |
|
328 | 328 | } |
329 | 329 | } |