@@ -275,6 +275,7 @@ |
||
275 | 275 | * @param string the email address |
276 | 276 | * @param string the link title |
277 | 277 | * @param mixed any attributes |
278 | + * @param string $email |
|
278 | 279 | * @return string |
279 | 280 | */ |
280 | 281 | function safe_mailto($email, $title = '', $attributes = '') |
@@ -213,13 +213,11 @@ discard block |
||
213 | 213 | |
214 | 214 | // Ref: http://www.w3schools.com/jsref/met_win_open.asp |
215 | 215 | $window_name = '_blank'; |
216 | - } |
|
217 | - elseif ( ! empty($attributes['window_name'])) |
|
216 | + } elseif ( ! empty($attributes['window_name'])) |
|
218 | 217 | { |
219 | 218 | $window_name = $attributes['window_name']; |
220 | 219 | unset($attributes['window_name']); |
221 | - } |
|
222 | - else |
|
220 | + } else |
|
223 | 221 | { |
224 | 222 | $window_name = '_blank'; |
225 | 223 | } |
@@ -308,8 +306,7 @@ discard block |
||
308 | 306 | } |
309 | 307 | $x[] = '"'; |
310 | 308 | } |
311 | - } |
|
312 | - else |
|
309 | + } else |
|
313 | 310 | { |
314 | 311 | for ($i = 0, $l = strlen($attributes); $i < $l; $i++) |
315 | 312 | { |
@@ -328,8 +325,7 @@ discard block |
||
328 | 325 | if ($ordinal < 128) |
329 | 326 | { |
330 | 327 | $x[] = '|'.$ordinal; |
331 | - } |
|
332 | - else |
|
328 | + } else |
|
333 | 329 | { |
334 | 330 | if (count($temp) === 0) |
335 | 331 | { |
@@ -482,8 +478,7 @@ discard block |
||
482 | 478 | if ($separator === 'dash') |
483 | 479 | { |
484 | 480 | $separator = '-'; |
485 | - } |
|
486 | - elseif ($separator === 'underscore') |
|
481 | + } elseif ($separator === 'underscore') |
|
487 | 482 | { |
488 | 483 | $separator = '_'; |
489 | 484 | } |
@@ -540,16 +535,14 @@ discard block |
||
540 | 535 | if ($method === 'auto' && isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) |
541 | 536 | { |
542 | 537 | $method = 'refresh'; |
543 | - } |
|
544 | - elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
538 | + } elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
545 | 539 | { |
546 | 540 | if (isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1') |
547 | 541 | { |
548 | 542 | $code = ($_SERVER['REQUEST_METHOD'] !== 'GET') |
549 | 543 | ? 303 // reference: http://en.wikipedia.org/wiki/Post/Redirect/Get |
550 | 544 | : 307; |
551 | - } |
|
552 | - else |
|
545 | + } else |
|
553 | 546 | { |
554 | 547 | $code = 302; |
555 | 548 | } |
@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 1.0.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 1.0.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |
@@ -81,7 +81,7 @@ |
||
81 | 81 | { |
82 | 82 | parent::__construct($params); |
83 | 83 | |
84 | - $CI =& get_instance(); |
|
84 | + $CI = & get_instance(); |
|
85 | 85 | isset($CI->db) OR $CI->load->database(); |
86 | 86 | $this->_db = $CI->db; |
87 | 87 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * |
80 | 80 | * @param string $id Cache ID |
81 | 81 | * @param mixed $data Data to store |
82 | - * @param int $ttol Length of time (in seconds) to cache the data |
|
82 | + * @param int $ttl Length of time (in seconds) to cache the data |
|
83 | 83 | * @param bool $raw Whether to store the raw value |
84 | 84 | * @return bool TRUE on success, FALSE on failure |
85 | 85 | */ |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @param string $id Cache ID |
116 | 116 | * @param int $offset Step/value to add |
117 | - * @return mixed New value on success or FALSE on failure |
|
117 | + * @return integer New value on success or FALSE on failure |
|
118 | 118 | */ |
119 | 119 | public function increment($id, $offset = 1) |
120 | 120 | { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * |
129 | 129 | * @param string $id Cache ID |
130 | 130 | * @param int $offset Step/value to reduce by |
131 | - * @return mixed New value on success or FALSE on failure |
|
131 | + * @return integer New value on success or FALSE on failure |
|
132 | 132 | */ |
133 | 133 | public function decrement($id, $offset = 1) |
134 | 134 | { |
@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 2.0.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 2.0.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @param string $id Cache ID |
99 | 99 | * @param int $offset Step/value to add |
100 | - * @return mixed New value on success or FALSE on failure |
|
100 | + * @return boolean New value on success or FALSE on failure |
|
101 | 101 | */ |
102 | 102 | public function increment($id, $offset = 1) |
103 | 103 | { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @param string $id Cache ID |
113 | 113 | * @param int $offset Step/value to reduce by |
114 | - * @return mixed New value on success or FALSE on failure |
|
114 | + * @return boolean New value on success or FALSE on failure |
|
115 | 115 | */ |
116 | 116 | public function decrement($id, $offset = 1) |
117 | 117 | { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * Insert items into the cart and save it to the session table |
125 | 125 | * |
126 | 126 | * @param array |
127 | - * @return bool |
|
127 | + * @return string|boolean |
|
128 | 128 | */ |
129 | 129 | public function insert($items = array()) |
130 | 130 | { |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * Insert |
179 | 179 | * |
180 | 180 | * @param array |
181 | - * @return bool |
|
181 | + * @return false|string |
|
182 | 182 | */ |
183 | 183 | protected function _insert($items = array()) |
184 | 184 | { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public function __construct($params = array()) |
100 | 100 | { |
101 | 101 | // Set the super object to a local variable for use later |
102 | - $this->CI =& get_instance(); |
|
102 | + $this->CI = & get_instance(); |
|
103 | 103 | |
104 | 104 | // Are any config settings being passed manually? If so, set them |
105 | 105 | $config = is_array($params) ? $params : array(); |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | */ |
547 | 547 | public function format_number($n = '') |
548 | 548 | { |
549 | - return ($n === '') ? '' : number_format( (float) $n, 2, '.', ','); |
|
549 | + return ($n === '') ? '' : number_format((float) $n, 2, '.', ','); |
|
550 | 550 | } |
551 | 551 | |
552 | 552 | // -------------------------------------------------------------------- |
@@ -147,8 +147,7 @@ discard block |
||
147 | 147 | { |
148 | 148 | $save_cart = TRUE; |
149 | 149 | } |
150 | - } |
|
151 | - else |
|
150 | + } else |
|
152 | 151 | { |
153 | 152 | foreach ($items as $val) |
154 | 153 | { |
@@ -248,8 +247,7 @@ discard block |
||
248 | 247 | if (isset($items['options']) && count($items['options']) > 0) |
249 | 248 | { |
250 | 249 | $rowid = md5($items['id'].serialize($items['options'])); |
251 | - } |
|
252 | - else |
|
250 | + } else |
|
253 | 251 | { |
254 | 252 | // No options were submitted so we simply MD5 the product ID. |
255 | 253 | // Technically, we don't need to MD5 the ID in this case, but it makes |
@@ -303,8 +301,7 @@ discard block |
||
303 | 301 | { |
304 | 302 | $save_cart = TRUE; |
305 | 303 | } |
306 | - } |
|
307 | - else |
|
304 | + } else |
|
308 | 305 | { |
309 | 306 | foreach ($items as $val) |
310 | 307 | { |
@@ -560,6 +560,7 @@ discard block |
||
560 | 560 | * |
561 | 561 | * @param string |
562 | 562 | * @param string |
563 | + * @param string $replyto |
|
563 | 564 | * @return CI_Email |
564 | 565 | */ |
565 | 566 | public function reply_to($replyto, $name = '') |
@@ -804,6 +805,8 @@ discard block |
||
804 | 805 | * |
805 | 806 | * @param string |
806 | 807 | * @param string |
808 | + * @param string $header |
|
809 | + * @param string $value |
|
807 | 810 | * @return CI_Email |
808 | 811 | */ |
809 | 812 | public function set_header($header, $value) |
@@ -962,7 +965,7 @@ discard block |
||
962 | 965 | * Get Mail Protocol |
963 | 966 | * |
964 | 967 | * @param bool |
965 | - * @return mixed |
|
968 | + * @return string|null |
|
966 | 969 | */ |
967 | 970 | protected function _get_protocol($return = TRUE) |
968 | 971 | { |
@@ -1168,6 +1171,8 @@ discard block |
||
1168 | 1171 | * |
1169 | 1172 | * @param string |
1170 | 1173 | * @param int line-length limit |
1174 | + * @param string $str |
|
1175 | + * @param integer $charlim |
|
1171 | 1176 | * @return string |
1172 | 1177 | */ |
1173 | 1178 | public function word_wrap($str, $charlim = NULL) |
@@ -1311,7 +1316,7 @@ discard block |
||
1311 | 1316 | /** |
1312 | 1317 | * Build Final Body and attachments |
1313 | 1318 | * |
1314 | - * @return bool |
|
1319 | + * @return null|boolean |
|
1315 | 1320 | */ |
1316 | 1321 | protected function _build_message() |
1317 | 1322 | { |
@@ -1465,6 +1470,7 @@ discard block |
||
1465 | 1470 | * Refer to RFC 2045 http://www.ietf.org/rfc/rfc2045.txt |
1466 | 1471 | * |
1467 | 1472 | * @param string |
1473 | + * @param string $str |
|
1468 | 1474 | * @return string |
1469 | 1475 | */ |
1470 | 1476 | protected function _prep_quoted_printable($str) |
@@ -1655,7 +1661,7 @@ discard block |
||
1655 | 1661 | * Send Email |
1656 | 1662 | * |
1657 | 1663 | * @param bool $auto_clear = TRUE |
1658 | - * @return bool |
|
1664 | + * @return null|boolean |
|
1659 | 1665 | */ |
1660 | 1666 | public function send($auto_clear = TRUE) |
1661 | 1667 | { |
@@ -1712,7 +1718,7 @@ discard block |
||
1712 | 1718 | /** |
1713 | 1719 | * Batch Bcc Send. Sends groups of BCCs in batches |
1714 | 1720 | * |
1715 | - * @return void |
|
1721 | + * @return false|null |
|
1716 | 1722 | */ |
1717 | 1723 | public function batch_bcc_send() |
1718 | 1724 | { |
@@ -1969,7 +1975,7 @@ discard block |
||
1969 | 1975 | /** |
1970 | 1976 | * SMTP Connect |
1971 | 1977 | * |
1972 | - * @return string |
|
1978 | + * @return boolean |
|
1973 | 1979 | */ |
1974 | 1980 | protected function _smtp_connect() |
1975 | 1981 | { |
@@ -2019,7 +2025,8 @@ discard block |
||
2019 | 2025 | * |
2020 | 2026 | * @param string |
2021 | 2027 | * @param string |
2022 | - * @return string |
|
2028 | + * @param string $cmd |
|
2029 | + * @return boolean |
|
2023 | 2030 | */ |
2024 | 2031 | protected function _send_command($cmd, $data = '') |
2025 | 2032 | { |
@@ -55,77 +55,77 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @var string |
57 | 57 | */ |
58 | - public $useragent = 'CodeIgniter'; |
|
58 | + public $useragent = 'CodeIgniter'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Path to the Sendmail binary. |
62 | 62 | * |
63 | 63 | * @var string |
64 | 64 | */ |
65 | - public $mailpath = '/usr/sbin/sendmail'; // Sendmail path |
|
65 | + public $mailpath = '/usr/sbin/sendmail'; // Sendmail path |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Which method to use for sending e-mails. |
69 | 69 | * |
70 | 70 | * @var string 'mail', 'sendmail' or 'smtp' |
71 | 71 | */ |
72 | - public $protocol = 'mail'; // mail/sendmail/smtp |
|
72 | + public $protocol = 'mail'; // mail/sendmail/smtp |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * STMP Server host |
76 | 76 | * |
77 | 77 | * @var string |
78 | 78 | */ |
79 | - public $smtp_host = ''; |
|
79 | + public $smtp_host = ''; |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * SMTP Username |
83 | 83 | * |
84 | 84 | * @var string |
85 | 85 | */ |
86 | - public $smtp_user = ''; |
|
86 | + public $smtp_user = ''; |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * SMTP Password |
90 | 90 | * |
91 | 91 | * @var string |
92 | 92 | */ |
93 | - public $smtp_pass = ''; |
|
93 | + public $smtp_pass = ''; |
|
94 | 94 | |
95 | 95 | /** |
96 | 96 | * SMTP Server port |
97 | 97 | * |
98 | 98 | * @var int |
99 | 99 | */ |
100 | - public $smtp_port = 25; |
|
100 | + public $smtp_port = 25; |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * SMTP connection timeout in seconds |
104 | 104 | * |
105 | 105 | * @var int |
106 | 106 | */ |
107 | - public $smtp_timeout = 5; |
|
107 | + public $smtp_timeout = 5; |
|
108 | 108 | |
109 | 109 | /** |
110 | 110 | * SMTP persistent connection |
111 | 111 | * |
112 | 112 | * @var bool |
113 | 113 | */ |
114 | - public $smtp_keepalive = FALSE; |
|
114 | + public $smtp_keepalive = FALSE; |
|
115 | 115 | |
116 | 116 | /** |
117 | 117 | * SMTP Encryption |
118 | 118 | * |
119 | 119 | * @var string empty, 'tls' or 'ssl' |
120 | 120 | */ |
121 | - public $smtp_crypto = ''; |
|
121 | + public $smtp_crypto = ''; |
|
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Whether to apply word-wrapping to the message body. |
125 | 125 | * |
126 | 126 | * @var bool |
127 | 127 | */ |
128 | - public $wordwrap = TRUE; |
|
128 | + public $wordwrap = TRUE; |
|
129 | 129 | |
130 | 130 | /** |
131 | 131 | * Number of characters to wrap at. |
@@ -133,49 +133,49 @@ discard block |
||
133 | 133 | * @see CI_Email::$wordwrap |
134 | 134 | * @var int |
135 | 135 | */ |
136 | - public $wrapchars = 76; |
|
136 | + public $wrapchars = 76; |
|
137 | 137 | |
138 | 138 | /** |
139 | 139 | * Message format. |
140 | 140 | * |
141 | 141 | * @var string 'text' or 'html' |
142 | 142 | */ |
143 | - public $mailtype = 'text'; |
|
143 | + public $mailtype = 'text'; |
|
144 | 144 | |
145 | 145 | /** |
146 | 146 | * Character set (default: utf-8) |
147 | 147 | * |
148 | 148 | * @var string |
149 | 149 | */ |
150 | - public $charset = 'utf-8'; |
|
150 | + public $charset = 'utf-8'; |
|
151 | 151 | |
152 | 152 | /** |
153 | 153 | * Multipart message |
154 | 154 | * |
155 | 155 | * @var string 'mixed' (in the body) or 'related' (separate) |
156 | 156 | */ |
157 | - public $multipart = 'mixed'; // "mixed" (in the body) or "related" (separate) |
|
157 | + public $multipart = 'mixed'; // "mixed" (in the body) or "related" (separate) |
|
158 | 158 | |
159 | 159 | /** |
160 | 160 | * Alternative message (for HTML messages only) |
161 | 161 | * |
162 | 162 | * @var string |
163 | 163 | */ |
164 | - public $alt_message = ''; |
|
164 | + public $alt_message = ''; |
|
165 | 165 | |
166 | 166 | /** |
167 | 167 | * Whether to validate e-mail addresses. |
168 | 168 | * |
169 | 169 | * @var bool |
170 | 170 | */ |
171 | - public $validate = FALSE; |
|
171 | + public $validate = FALSE; |
|
172 | 172 | |
173 | 173 | /** |
174 | 174 | * X-Priority header value. |
175 | 175 | * |
176 | 176 | * @var int 1-5 |
177 | 177 | */ |
178 | - public $priority = 3; // Default priority (1 - 5) |
|
178 | + public $priority = 3; // Default priority (1 - 5) |
|
179 | 179 | |
180 | 180 | /** |
181 | 181 | * Newline character sequence. |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * @link http://www.ietf.org/rfc/rfc822.txt |
185 | 185 | * @var string "\r\n" or "\n" |
186 | 186 | */ |
187 | - public $newline = "\n"; // Default newline. "\r\n" or "\n" (Use "\r\n" to comply with RFC 822) |
|
187 | + public $newline = "\n"; // Default newline. "\r\n" or "\n" (Use "\r\n" to comply with RFC 822) |
|
188 | 188 | |
189 | 189 | /** |
190 | 190 | * CRLF character sequence |
@@ -198,14 +198,14 @@ discard block |
||
198 | 198 | * @link http://www.ietf.org/rfc/rfc822.txt |
199 | 199 | * @var string |
200 | 200 | */ |
201 | - public $crlf = "\n"; |
|
201 | + public $crlf = "\n"; |
|
202 | 202 | |
203 | 203 | /** |
204 | 204 | * Whether to use Delivery Status Notification. |
205 | 205 | * |
206 | 206 | * @var bool |
207 | 207 | */ |
208 | - public $dsn = FALSE; |
|
208 | + public $dsn = FALSE; |
|
209 | 209 | |
210 | 210 | /** |
211 | 211 | * Whether to send multipart alternatives. |
@@ -213,14 +213,14 @@ discard block |
||
213 | 213 | * |
214 | 214 | * @var bool |
215 | 215 | */ |
216 | - public $send_multipart = TRUE; |
|
216 | + public $send_multipart = TRUE; |
|
217 | 217 | |
218 | 218 | /** |
219 | 219 | * Whether to send messages to BCC recipients in batches. |
220 | 220 | * |
221 | 221 | * @var bool |
222 | 222 | */ |
223 | - public $bcc_batch_mode = FALSE; |
|
223 | + public $bcc_batch_mode = FALSE; |
|
224 | 224 | |
225 | 225 | /** |
226 | 226 | * BCC Batch max number size. |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * @see CI_Email::$bcc_batch_mode |
229 | 229 | * @var int |
230 | 230 | */ |
231 | - public $bcc_batch_size = 200; |
|
231 | + public $bcc_batch_size = 200; |
|
232 | 232 | |
233 | 233 | // -------------------------------------------------------------------- |
234 | 234 | |
@@ -237,77 +237,77 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @var bool |
239 | 239 | */ |
240 | - protected $_safe_mode = FALSE; |
|
240 | + protected $_safe_mode = FALSE; |
|
241 | 241 | |
242 | 242 | /** |
243 | 243 | * Subject header |
244 | 244 | * |
245 | 245 | * @var string |
246 | 246 | */ |
247 | - protected $_subject = ''; |
|
247 | + protected $_subject = ''; |
|
248 | 248 | |
249 | 249 | /** |
250 | 250 | * Message body |
251 | 251 | * |
252 | 252 | * @var string |
253 | 253 | */ |
254 | - protected $_body = ''; |
|
254 | + protected $_body = ''; |
|
255 | 255 | |
256 | 256 | /** |
257 | 257 | * Final message body to be sent. |
258 | 258 | * |
259 | 259 | * @var string |
260 | 260 | */ |
261 | - protected $_finalbody = ''; |
|
261 | + protected $_finalbody = ''; |
|
262 | 262 | |
263 | 263 | /** |
264 | 264 | * multipart/alternative boundary |
265 | 265 | * |
266 | 266 | * @var string |
267 | 267 | */ |
268 | - protected $_alt_boundary = ''; |
|
268 | + protected $_alt_boundary = ''; |
|
269 | 269 | |
270 | 270 | /** |
271 | 271 | * Attachment boundary |
272 | 272 | * |
273 | 273 | * @var string |
274 | 274 | */ |
275 | - protected $_atc_boundary = ''; |
|
275 | + protected $_atc_boundary = ''; |
|
276 | 276 | |
277 | 277 | /** |
278 | 278 | * Final headers to send |
279 | 279 | * |
280 | 280 | * @var string |
281 | 281 | */ |
282 | - protected $_header_str = ''; |
|
282 | + protected $_header_str = ''; |
|
283 | 283 | |
284 | 284 | /** |
285 | 285 | * SMTP Connection socket placeholder |
286 | 286 | * |
287 | 287 | * @var resource |
288 | 288 | */ |
289 | - protected $_smtp_connect = ''; |
|
289 | + protected $_smtp_connect = ''; |
|
290 | 290 | |
291 | 291 | /** |
292 | 292 | * Mail encoding |
293 | 293 | * |
294 | 294 | * @var string '8bit' or '7bit' |
295 | 295 | */ |
296 | - protected $_encoding = '8bit'; |
|
296 | + protected $_encoding = '8bit'; |
|
297 | 297 | |
298 | 298 | /** |
299 | 299 | * Whether to perform SMTP authentication |
300 | 300 | * |
301 | 301 | * @var bool |
302 | 302 | */ |
303 | - protected $_smtp_auth = FALSE; |
|
303 | + protected $_smtp_auth = FALSE; |
|
304 | 304 | |
305 | 305 | /** |
306 | 306 | * Whether to send a Reply-To header |
307 | 307 | * |
308 | 308 | * @var bool |
309 | 309 | */ |
310 | - protected $_replyto_flag = FALSE; |
|
310 | + protected $_replyto_flag = FALSE; |
|
311 | 311 | |
312 | 312 | /** |
313 | 313 | * Debug messages |
@@ -315,42 +315,42 @@ discard block |
||
315 | 315 | * @see CI_Email::print_debugger() |
316 | 316 | * @var string |
317 | 317 | */ |
318 | - protected $_debug_msg = array(); |
|
318 | + protected $_debug_msg = array(); |
|
319 | 319 | |
320 | 320 | /** |
321 | 321 | * Recipients |
322 | 322 | * |
323 | 323 | * @var string[] |
324 | 324 | */ |
325 | - protected $_recipients = array(); |
|
325 | + protected $_recipients = array(); |
|
326 | 326 | |
327 | 327 | /** |
328 | 328 | * CC Recipients |
329 | 329 | * |
330 | 330 | * @var string[] |
331 | 331 | */ |
332 | - protected $_cc_array = array(); |
|
332 | + protected $_cc_array = array(); |
|
333 | 333 | |
334 | 334 | /** |
335 | 335 | * BCC Recipients |
336 | 336 | * |
337 | 337 | * @var string[] |
338 | 338 | */ |
339 | - protected $_bcc_array = array(); |
|
339 | + protected $_bcc_array = array(); |
|
340 | 340 | |
341 | 341 | /** |
342 | 342 | * Message headers |
343 | 343 | * |
344 | 344 | * @var string[] |
345 | 345 | */ |
346 | - protected $_headers = array(); |
|
346 | + protected $_headers = array(); |
|
347 | 347 | |
348 | 348 | /** |
349 | 349 | * Attachment data |
350 | 350 | * |
351 | 351 | * @var array |
352 | 352 | */ |
353 | - protected $_attachments = array(); |
|
353 | + protected $_attachments = array(); |
|
354 | 354 | |
355 | 355 | /** |
356 | 356 | * Valid $protocol values |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | * @see CI_Email::$protocol |
359 | 359 | * @var string[] |
360 | 360 | */ |
361 | - protected $_protocols = array('mail', 'sendmail', 'smtp'); |
|
361 | + protected $_protocols = array('mail', 'sendmail', 'smtp'); |
|
362 | 362 | |
363 | 363 | /** |
364 | 364 | * Base charsets |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | * |
369 | 369 | * @var string[] |
370 | 370 | */ |
371 | - protected $_base_charsets = array('us-ascii', 'iso-2022-'); |
|
371 | + protected $_base_charsets = array('us-ascii', 'iso-2022-'); |
|
372 | 372 | |
373 | 373 | /** |
374 | 374 | * Bit depths |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | * @see CI_Email::$_encoding |
379 | 379 | * @var string[] |
380 | 380 | */ |
381 | - protected $_bit_depths = array('7bit', '8bit'); |
|
381 | + protected $_bit_depths = array('7bit', '8bit'); |
|
382 | 382 | |
383 | 383 | /** |
384 | 384 | * $priority translations |
@@ -482,11 +482,11 @@ discard block |
||
482 | 482 | */ |
483 | 483 | public function clear($clear_attachments = FALSE) |
484 | 484 | { |
485 | - $this->_subject = ''; |
|
486 | - $this->_body = ''; |
|
487 | - $this->_finalbody = ''; |
|
485 | + $this->_subject = ''; |
|
486 | + $this->_body = ''; |
|
487 | + $this->_finalbody = ''; |
|
488 | 488 | $this->_header_str = ''; |
489 | - $this->_replyto_flag = FALSE; |
|
489 | + $this->_replyto_flag = FALSE; |
|
490 | 490 | $this->_recipients = array(); |
491 | 491 | $this->_cc_array = array(); |
492 | 492 | $this->_bcc_array = array(); |
@@ -755,12 +755,12 @@ discard block |
||
755 | 755 | } |
756 | 756 | else |
757 | 757 | { |
758 | - $file_content =& $file; // buffered file |
|
758 | + $file_content = & $file; // buffered file |
|
759 | 759 | } |
760 | 760 | |
761 | 761 | $this->_attachments[] = array( |
762 | 762 | 'name' => array($file, $newname), |
763 | - 'disposition' => empty($disposition) ? 'attachment' : $disposition, // Can also be 'inline' Not sure if it matters |
|
763 | + 'disposition' => empty($disposition) ? 'attachment' : $disposition, // Can also be 'inline' Not sure if it matters |
|
764 | 764 | 'type' => $mime, |
765 | 765 | 'content' => chunk_split(base64_encode($file_content)) |
766 | 766 | ); |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | { |
1015 | 1015 | return (count($this->_attachments) === 0) ? 'html' : 'html-attach'; |
1016 | 1016 | } |
1017 | - elseif ($this->mailtype === 'text' && count($this->_attachments) > 0) |
|
1017 | + elseif ($this->mailtype === 'text' && count($this->_attachments) > 0) |
|
1018 | 1018 | { |
1019 | 1019 | return 'plain-attach'; |
1020 | 1020 | } |
@@ -1036,7 +1036,7 @@ discard block |
||
1036 | 1036 | $timezone = date('Z'); |
1037 | 1037 | $operator = ($timezone[0] === '-') ? '-' : '+'; |
1038 | 1038 | $timezone = abs($timezone); |
1039 | - $timezone = floor($timezone/3600) * 100 + ($timezone % 3600) / 60; |
|
1039 | + $timezone = floor($timezone / 3600) * 100 + ($timezone % 3600) / 60; |
|
1040 | 1040 | |
1041 | 1041 | return sprintf('%s %s%04d', date('D, j M Y H:i:s'), $operator, $timezone); |
1042 | 1042 | } |
@@ -1543,7 +1543,7 @@ discard block |
||
1543 | 1543 | // as they are the encoding delimiter! |
1544 | 1544 | elseif ($ascii === 61) |
1545 | 1545 | { |
1546 | - $char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); // =3D |
|
1546 | + $char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); // =3D |
|
1547 | 1547 | } |
1548 | 1548 | elseif ( ! in_array($ascii, $ascii_safe_chars, TRUE)) |
1549 | 1549 | { |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | $set = ''; |
1735 | 1735 | } |
1736 | 1736 | |
1737 | - if ($i === $c-1) |
|
1737 | + if ($i === $c - 1) |
|
1738 | 1738 | { |
1739 | 1739 | $chunk[] = substr($set, 1); |
1740 | 1740 | } |
@@ -2302,7 +2302,7 @@ discard block |
||
2302 | 2302 | */ |
2303 | 2303 | protected function _set_error_message($msg, $val = '') |
2304 | 2304 | { |
2305 | - $CI =& get_instance(); |
|
2305 | + $CI = & get_instance(); |
|
2306 | 2306 | $CI->lang->load('email'); |
2307 | 2307 | |
2308 | 2308 | if (sscanf($msg, 'lang:%s', $line) !== 1 OR FALSE === ($line = $CI->lang->line($line))) |
@@ -2327,7 +2327,7 @@ discard block |
||
2327 | 2327 | { |
2328 | 2328 | $ext = strtolower($ext); |
2329 | 2329 | |
2330 | - $mimes =& get_mimes(); |
|
2330 | + $mimes = & get_mimes(); |
|
2331 | 2331 | |
2332 | 2332 | if (isset($mimes[$ext])) |
2333 | 2333 | { |
@@ -412,8 +412,7 @@ discard block |
||
412 | 412 | if (count($config) > 0) |
413 | 413 | { |
414 | 414 | $this->initialize($config); |
415 | - } |
|
416 | - else |
|
415 | + } else |
|
417 | 416 | { |
418 | 417 | $this->_smtp_auth = ! ($this->smtp_user === '' && $this->smtp_pass === ''); |
419 | 418 | } |
@@ -458,8 +457,7 @@ discard block |
||
458 | 457 | if (method_exists($this, $method)) |
459 | 458 | { |
460 | 459 | $this->$method($val); |
461 | - } |
|
462 | - else |
|
460 | + } else |
|
463 | 461 | { |
464 | 462 | $this->$key = $val; |
465 | 463 | } |
@@ -538,8 +536,7 @@ discard block |
||
538 | 536 | { |
539 | 537 | // add slashes for non-printing characters, slashes, and double quotes, and surround it in double quotes |
540 | 538 | $name = '"'.addcslashes($name, "\0..\37\177'\"\\").'"'; |
541 | - } |
|
542 | - else |
|
539 | + } else |
|
543 | 540 | { |
544 | 541 | $name = $this->_prep_q_encoding($name); |
545 | 542 | } |
@@ -672,8 +669,7 @@ discard block |
||
672 | 669 | if ($this->_get_protocol() === 'smtp' OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) |
673 | 670 | { |
674 | 671 | $this->_bcc_array = $bcc; |
675 | - } |
|
676 | - else |
|
672 | + } else |
|
677 | 673 | { |
678 | 674 | $this->set_header('Bcc', implode(', ', $bcc)); |
679 | 675 | } |
@@ -752,8 +748,7 @@ discard block |
||
752 | 748 | $file_content = stream_get_contents($fp); |
753 | 749 | $mime = $this->_mime_types(pathinfo($file, PATHINFO_EXTENSION)); |
754 | 750 | fclose($fp); |
755 | - } |
|
756 | - else |
|
751 | + } else |
|
757 | 752 | { |
758 | 753 | $file_content =& $file; // buffered file |
759 | 754 | } |
@@ -1013,12 +1008,10 @@ discard block |
||
1013 | 1008 | if ($this->mailtype === 'html') |
1014 | 1009 | { |
1015 | 1010 | return (count($this->_attachments) === 0) ? 'html' : 'html-attach'; |
1016 | - } |
|
1017 | - elseif ($this->mailtype === 'text' && count($this->_attachments) > 0) |
|
1011 | + } elseif ($this->mailtype === 'text' && count($this->_attachments) > 0) |
|
1018 | 1012 | { |
1019 | 1013 | return 'plain-attach'; |
1020 | - } |
|
1021 | - else |
|
1014 | + } else |
|
1022 | 1015 | { |
1023 | 1016 | return 'plain'; |
1024 | 1017 | } |
@@ -1337,8 +1330,7 @@ discard block |
||
1337 | 1330 | { |
1338 | 1331 | $this->_header_str .= $hdr; |
1339 | 1332 | $this->_finalbody = $this->_body; |
1340 | - } |
|
1341 | - else |
|
1333 | + } else |
|
1342 | 1334 | { |
1343 | 1335 | $this->_finalbody = $hdr.$this->newline.$this->newline.$this->_body; |
1344 | 1336 | } |
@@ -1351,8 +1343,7 @@ discard block |
||
1351 | 1343 | { |
1352 | 1344 | $hdr .= 'Content-Type: text/html; charset='.$this->charset.$this->newline |
1353 | 1345 | .'Content-Transfer-Encoding: quoted-printable'; |
1354 | - } |
|
1355 | - else |
|
1346 | + } else |
|
1356 | 1347 | { |
1357 | 1348 | $hdr .= 'Content-Type: multipart/alternative; boundary="'.$this->_alt_boundary.'"'; |
1358 | 1349 | |
@@ -1372,8 +1363,7 @@ discard block |
||
1372 | 1363 | if ($this->_get_protocol() === 'mail') |
1373 | 1364 | { |
1374 | 1365 | $this->_header_str .= $hdr; |
1375 | - } |
|
1376 | - else |
|
1366 | + } else |
|
1377 | 1367 | { |
1378 | 1368 | $this->_finalbody = $hdr.$this->newline.$this->newline.$this->_finalbody; |
1379 | 1369 | } |
@@ -1496,8 +1486,7 @@ discard block |
||
1496 | 1486 | if (is_php('5.3')) |
1497 | 1487 | { |
1498 | 1488 | return quoted_printable_encode($str); |
1499 | - } |
|
1500 | - elseif (function_exists('imap_8bit')) |
|
1489 | + } elseif (function_exists('imap_8bit')) |
|
1501 | 1490 | { |
1502 | 1491 | return imap_8bit($str); |
1503 | 1492 | } |
@@ -1544,8 +1533,7 @@ discard block |
||
1544 | 1533 | elseif ($ascii === 61) |
1545 | 1534 | { |
1546 | 1535 | $char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); // =3D |
1547 | - } |
|
1548 | - elseif ( ! in_array($ascii, $ascii_safe_chars, TRUE)) |
|
1536 | + } elseif ( ! in_array($ascii, $ascii_safe_chars, TRUE)) |
|
1549 | 1537 | { |
1550 | 1538 | $char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); |
1551 | 1539 | } |
@@ -1613,8 +1601,7 @@ discard block |
||
1613 | 1601 | } |
1614 | 1602 | |
1615 | 1603 | $chars = iconv_strlen($str, 'UTF-8'); |
1616 | - } |
|
1617 | - elseif (MB_ENABLED === TRUE) |
|
1604 | + } elseif (MB_ENABLED === TRUE) |
|
1618 | 1605 | { |
1619 | 1606 | $chars = mb_strlen($str, 'UTF-8'); |
1620 | 1607 | } |
@@ -1637,8 +1624,7 @@ discard block |
||
1637 | 1624 | $output .= '?='.$this->crlf // EOL |
1638 | 1625 | .' =?'.$this->charset.'?Q?'.$chr; // New line |
1639 | 1626 | $length = 6 + strlen($this->charset) + $l; // Reset the length for the new line |
1640 | - } |
|
1641 | - else |
|
1627 | + } else |
|
1642 | 1628 | { |
1643 | 1629 | $output .= $chr; |
1644 | 1630 | $length += $l; |
@@ -1749,8 +1735,7 @@ discard block |
||
1749 | 1735 | if ($this->protocol !== 'smtp') |
1750 | 1736 | { |
1751 | 1737 | $this->set_header('Bcc', implode(', ', $bcc)); |
1752 | - } |
|
1753 | - else |
|
1738 | + } else |
|
1754 | 1739 | { |
1755 | 1740 | $this->_bcc_array = $bcc; |
1756 | 1741 | } |
@@ -1833,8 +1818,7 @@ discard block |
||
1833 | 1818 | if ($this->_safe_mode === TRUE) |
1834 | 1819 | { |
1835 | 1820 | return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str); |
1836 | - } |
|
1837 | - else |
|
1821 | + } else |
|
1838 | 1822 | { |
1839 | 1823 | // most documentation of sendmail using the "-f" flag lacks a space after it, however |
1840 | 1824 | // we've encountered servers that seem to require it to be in place. |
@@ -1857,10 +1841,12 @@ discard block |
||
1857 | 1841 | $this->mailpath.' -oi -f '.$this->clean_email($this->_headers['From']) |
1858 | 1842 | .' -t -r '.$this->clean_email($this->_headers['Return-Path']) |
1859 | 1843 | , 'w')) |
1860 | - ) // server probably has popen disabled, so nothing we can do to get a verbose error. |
|
1844 | + ) { |
|
1845 | + // server probably has popen disabled, so nothing we can do to get a verbose error. |
|
1861 | 1846 | { |
1862 | 1847 | return FALSE; |
1863 | 1848 | } |
1849 | + } |
|
1864 | 1850 | |
1865 | 1851 | fputs($fp, $this->_header_str); |
1866 | 1852 | fputs($fp, $this->_finalbody); |
@@ -1955,8 +1941,7 @@ discard block |
||
1955 | 1941 | if ($this->smtp_keepalive) |
1956 | 1942 | { |
1957 | 1943 | $this->_send_command('reset'); |
1958 | - } |
|
1959 | - else |
|
1944 | + } else |
|
1960 | 1945 | { |
1961 | 1946 | $this->_send_command('quit'); |
1962 | 1947 | } |
@@ -2030,8 +2015,7 @@ discard block |
||
2030 | 2015 | if ($this->_smtp_auth OR $this->_get_encoding() === '8bit') |
2031 | 2016 | { |
2032 | 2017 | $this->_send_data('EHLO '.$this->_get_hostname()); |
2033 | - } |
|
2034 | - else |
|
2018 | + } else |
|
2035 | 2019 | { |
2036 | 2020 | $this->_send_data('HELO '.$this->_get_hostname()); |
2037 | 2021 | } |
@@ -2053,8 +2037,7 @@ discard block |
||
2053 | 2037 | if ($this->dsn) |
2054 | 2038 | { |
2055 | 2039 | $this->_send_data('RCPT TO:<'.$data.'> NOTIFY=SUCCESS,DELAY,FAILURE ORCPT=rfc822;'.$data); |
2056 | - } |
|
2057 | - else |
|
2040 | + } else |
|
2058 | 2041 | { |
2059 | 2042 | $this->_send_data('RCPT TO:<'.$data.'>'); |
2060 | 2043 | } |
@@ -2120,11 +2103,12 @@ discard block |
||
2120 | 2103 | |
2121 | 2104 | $reply = $this->_get_smtp_data(); |
2122 | 2105 | |
2123 | - if (strpos($reply, '503') === 0) // Already authenticated |
|
2106 | + if (strpos($reply, '503') === 0) { |
|
2107 | + // Already authenticated |
|
2124 | 2108 | { |
2125 | 2109 | return TRUE; |
2126 | 2110 | } |
2127 | - elseif (strpos($reply, '334') !== 0) |
|
2111 | + } elseif (strpos($reply, '334') !== 0) |
|
2128 | 2112 | { |
2129 | 2113 | $this->_set_error_message('lang:email_failed_smtp_login', $reply); |
2130 | 2114 | return FALSE; |
@@ -2176,8 +2160,7 @@ discard block |
||
2176 | 2160 | if ($timestamp === 0) |
2177 | 2161 | { |
2178 | 2162 | $timestamp = time(); |
2179 | - } |
|
2180 | - elseif ($timestamp < (time() - $this->smtp_timeout)) |
|
2163 | + } elseif ($timestamp < (time() - $this->smtp_timeout)) |
|
2181 | 2164 | { |
2182 | 2165 | $result = FALSE; |
2183 | 2166 | break; |
@@ -2185,8 +2168,7 @@ discard block |
||
2185 | 2168 | |
2186 | 2169 | usleep(250000); |
2187 | 2170 | continue; |
2188 | - } |
|
2189 | - else |
|
2171 | + } else |
|
2190 | 2172 | { |
2191 | 2173 | $timestamp = 0; |
2192 | 2174 | } |
@@ -2308,8 +2290,7 @@ discard block |
||
2308 | 2290 | if (sscanf($msg, 'lang:%s', $line) !== 1 OR FALSE === ($line = $CI->lang->line($line))) |
2309 | 2291 | { |
2310 | 2292 | $this->_debug_msg[] = str_replace('%s', $val, $msg).'<br />'; |
2311 | - } |
|
2312 | - else |
|
2293 | + } else |
|
2313 | 2294 | { |
2314 | 2295 | $this->_debug_msg[] = str_replace('%s', $val, $line).'<br />'; |
2315 | 2296 | } |
@@ -245,6 +245,8 @@ discard block |
||
245 | 245 | * |
246 | 246 | * @param string |
247 | 247 | * @param string |
248 | + * @param string $string |
|
249 | + * @param string $key |
|
248 | 250 | * @return string |
249 | 251 | */ |
250 | 252 | protected function _xor_decode($string, $key) |
@@ -290,6 +292,7 @@ discard block |
||
290 | 292 | * |
291 | 293 | * @param string |
292 | 294 | * @param string |
295 | + * @param string $key |
|
293 | 296 | * @return string |
294 | 297 | */ |
295 | 298 | public function mcrypt_encode($data, $key) |
@@ -306,6 +309,8 @@ discard block |
||
306 | 309 | * |
307 | 310 | * @param string |
308 | 311 | * @param string |
312 | + * @param string $data |
|
313 | + * @param string $key |
|
309 | 314 | * @return string |
310 | 315 | */ |
311 | 316 | public function mcrypt_decode($data, $key) |
@@ -332,6 +337,7 @@ discard block |
||
332 | 337 | * |
333 | 338 | * @param string |
334 | 339 | * @param string |
340 | + * @param string $data |
|
335 | 341 | * @return string |
336 | 342 | */ |
337 | 343 | protected function _add_cipher_noise($data, $key) |
@@ -422,7 +428,7 @@ discard block |
||
422 | 428 | /** |
423 | 429 | * Get Mcrypt cipher Value |
424 | 430 | * |
425 | - * @return int |
|
431 | + * @return string |
|
426 | 432 | */ |
427 | 433 | protected function _get_cipher() |
428 | 434 | { |
@@ -55,21 +55,21 @@ |
||
55 | 55 | * |
56 | 56 | * @var string |
57 | 57 | */ |
58 | - public $encryption_key = ''; |
|
58 | + public $encryption_key = ''; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Type of hash operation |
62 | 62 | * |
63 | 63 | * @var string |
64 | 64 | */ |
65 | - protected $_hash_type = 'sha1'; |
|
65 | + protected $_hash_type = 'sha1'; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Flag for the existence of mcrypt |
69 | 69 | * |
70 | 70 | * @var bool |
71 | 71 | */ |
72 | - protected $_mcrypt_exists = FALSE; |
|
72 | + protected $_mcrypt_exists = FALSE; |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Current cipher to be used with mcrypt |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | * Get params |
641 | 641 | * |
642 | 642 | * @param array $params Input parameters |
643 | - * @return array |
|
643 | + * @return string |
|
644 | 644 | */ |
645 | 645 | protected function _get_params($params) |
646 | 646 | { |
@@ -830,10 +830,10 @@ discard block |
||
830 | 830 | * HKDF |
831 | 831 | * |
832 | 832 | * @link https://tools.ietf.org/rfc/rfc5869.txt |
833 | - * @param $key Input key |
|
833 | + * @param string $key Input key |
|
834 | 834 | * @param $digest A SHA-2 hashing algorithm |
835 | 835 | * @param $salt Optional salt |
836 | - * @param $length Output length (defaults to the selected digest size) |
|
836 | + * @param integer $length Output length (defaults to the selected digest size) |
|
837 | 837 | * @param $info Optional context/application-specific info |
838 | 838 | * @return string A pseudo-random key |
839 | 839 | */ |
@@ -590,7 +590,7 @@ |
||
590 | 590 | // Remove PKCS#7 padding, if necessary |
591 | 591 | if (in_array(strtolower(mcrypt_enc_get_modes_name($params['handle'])), array('cbc', 'ecb'), TRUE)) |
592 | 592 | { |
593 | - $data = self::substr($data, 0, -ord($data[self::strlen($data)-1])); |
|
593 | + $data = self::substr($data, 0, -ord($data[self::strlen($data) - 1])); |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | mcrypt_generic_deinit($params['handle']); |
@@ -191,13 +191,11 @@ discard block |
||
191 | 191 | if ($this->_drivers[$params['driver']]) |
192 | 192 | { |
193 | 193 | $this->_driver = $params['driver']; |
194 | - } |
|
195 | - else |
|
194 | + } else |
|
196 | 195 | { |
197 | 196 | log_message('error', "Encryption: Driver '".$params['driver']."' is not available."); |
198 | 197 | } |
199 | - } |
|
200 | - else |
|
198 | + } else |
|
201 | 199 | { |
202 | 200 | log_message('error', "Encryption: Unknown driver '".$params['driver']."' cannot be configured."); |
203 | 201 | } |
@@ -236,8 +234,7 @@ discard block |
||
236 | 234 | if ( ! in_array($params['cipher'], mcrypt_list_algorithms(), TRUE)) |
237 | 235 | { |
238 | 236 | log_message('error', 'Encryption: MCrypt cipher '.strtoupper($params['cipher']).' is not available.'); |
239 | - } |
|
240 | - else |
|
237 | + } else |
|
241 | 238 | { |
242 | 239 | $this->_cipher = $params['cipher']; |
243 | 240 | } |
@@ -249,8 +246,7 @@ discard block |
||
249 | 246 | if ( ! isset($this->_modes['mcrypt'][$params['mode']])) |
250 | 247 | { |
251 | 248 | log_message('error', 'Encryption: MCrypt mode '.strtoupper($params['mode']).' is not available.'); |
252 | - } |
|
253 | - else |
|
249 | + } else |
|
254 | 250 | { |
255 | 251 | $this->_mode = $this->_modes['mcrypt'][$params['mode']]; |
256 | 252 | } |
@@ -269,8 +265,7 @@ discard block |
||
269 | 265 | if ($this->_handle = mcrypt_module_open($this->_cipher, '', $this->_mode, '')) |
270 | 266 | { |
271 | 267 | log_message('info', 'Encryption: MCrypt cipher '.strtoupper($this->_cipher).' initialized in '.strtoupper($this->_mode).' mode.'); |
272 | - } |
|
273 | - else |
|
268 | + } else |
|
274 | 269 | { |
275 | 270 | log_message('error', 'Encryption: Unable to initialize MCrypt with cipher '.strtoupper($this->_cipher).' in '.strtoupper($this->_mode).' mode.'); |
276 | 271 | } |
@@ -300,8 +295,7 @@ discard block |
||
300 | 295 | if ( ! isset($this->_modes['openssl'][$params['mode']])) |
301 | 296 | { |
302 | 297 | log_message('error', 'Encryption: OpenSSL mode '.strtoupper($params['mode']).' is not available.'); |
303 | - } |
|
304 | - else |
|
298 | + } else |
|
305 | 299 | { |
306 | 300 | $this->_mode = $this->_modes['openssl'][$params['mode']]; |
307 | 301 | } |
@@ -318,8 +312,7 @@ discard block |
||
318 | 312 | { |
319 | 313 | $this->_handle = NULL; |
320 | 314 | log_message('error', 'Encryption: Unable to initialize OpenSSL with method '.strtoupper($handle).'.'); |
321 | - } |
|
322 | - else |
|
315 | + } else |
|
323 | 316 | { |
324 | 317 | $this->_handle = $handle; |
325 | 318 | log_message('info', 'Encryption: OpenSSL initialized with method '.strtoupper($handle).'.'); |
@@ -564,14 +557,12 @@ discard block |
||
564 | 557 | { |
565 | 558 | $iv = self::substr($data, 0, $iv_size); |
566 | 559 | $data = self::substr($data, $iv_size); |
567 | - } |
|
568 | - else |
|
560 | + } else |
|
569 | 561 | { |
570 | 562 | // MCrypt is dumb and this is ignored, only size matters |
571 | 563 | $iv = str_repeat("\x0", $iv_size); |
572 | 564 | } |
573 | - } |
|
574 | - else |
|
565 | + } else |
|
575 | 566 | { |
576 | 567 | $iv = NULL; |
577 | 568 | } |
@@ -617,8 +608,7 @@ discard block |
||
617 | 608 | { |
618 | 609 | $iv = self::substr($data, 0, $iv_size); |
619 | 610 | $data = self::substr($data, $iv_size); |
620 | - } |
|
621 | - else |
|
611 | + } else |
|
622 | 612 | { |
623 | 613 | $iv = NULL; |
624 | 614 | } |
@@ -657,8 +647,7 @@ discard block |
||
657 | 647 | 'hmac_key' => NULL |
658 | 648 | ) |
659 | 649 | : FALSE; |
660 | - } |
|
661 | - elseif ( ! isset($params['cipher'], $params['mode'], $params['key'])) |
|
650 | + } elseif ( ! isset($params['cipher'], $params['mode'], $params['key'])) |
|
662 | 651 | { |
663 | 652 | return FALSE; |
664 | 653 | } |
@@ -669,8 +658,7 @@ discard block |
||
669 | 658 | if ( ! isset($this->_modes[$this->_driver][$params['mode']])) |
670 | 659 | { |
671 | 660 | return FALSE; |
672 | - } |
|
673 | - else |
|
661 | + } else |
|
674 | 662 | { |
675 | 663 | $params['mode'] = $this->_modes[$this->_driver][$params['mode']]; |
676 | 664 | } |
@@ -679,22 +667,19 @@ discard block |
||
679 | 667 | if (isset($params['hmac']) && $params['hmac'] === FALSE) |
680 | 668 | { |
681 | 669 | $params['hmac_digest'] = $params['hmac_key'] = NULL; |
682 | - } |
|
683 | - else |
|
670 | + } else |
|
684 | 671 | { |
685 | 672 | if ( ! isset($params['hmac_key'])) |
686 | 673 | { |
687 | 674 | return FALSE; |
688 | - } |
|
689 | - elseif (isset($params['hmac_digest'])) |
|
675 | + } elseif (isset($params['hmac_digest'])) |
|
690 | 676 | { |
691 | 677 | $params['hmac_digest'] = strtolower($params['hmac_digest']); |
692 | 678 | if ( ! isset($this->_digests[$params['hmac_digest']])) |
693 | 679 | { |
694 | 680 | return FALSE; |
695 | 681 | } |
696 | - } |
|
697 | - else |
|
682 | + } else |
|
698 | 683 | { |
699 | 684 | $params['hmac_digest'] = 'sha512'; |
700 | 685 | } |
@@ -847,8 +832,7 @@ discard block |
||
847 | 832 | if (empty($length) OR ! is_int($length)) |
848 | 833 | { |
849 | 834 | $length = $this->_digests[$digest]; |
850 | - } |
|
851 | - elseif ($length > (255 * $this->_digests[$digest])) |
|
835 | + } elseif ($length > (255 * $this->_digests[$digest])) |
|
852 | 836 | { |
853 | 837 | return FALSE; |
854 | 838 | } |
@@ -880,8 +864,7 @@ discard block |
||
880 | 864 | if ($key === 'mode') |
881 | 865 | { |
882 | 866 | return array_search($this->_mode, $this->_modes[$this->_driver], TRUE); |
883 | - } |
|
884 | - elseif (in_array($key, array('cipher', 'driver', 'drivers', 'digests'), TRUE)) |
|
867 | + } elseif (in_array($key, array('cipher', 'driver', 'drivers', 'digests'), TRUE)) |
|
885 | 868 | { |
886 | 869 | return $this->{'_'.$key}; |
887 | 870 | } |
@@ -1237,6 +1237,7 @@ |
||
1237 | 1237 | * Valid Email |
1238 | 1238 | * |
1239 | 1239 | * @param string |
1240 | + * @param string $str |
|
1240 | 1241 | * @return bool |
1241 | 1242 | */ |
1242 | 1243 | public function valid_email($str) |
@@ -60,63 +60,63 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @var array |
62 | 62 | */ |
63 | - protected $_field_data = array(); |
|
63 | + protected $_field_data = array(); |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Validation rules for the current form |
67 | 67 | * |
68 | 68 | * @var array |
69 | 69 | */ |
70 | - protected $_config_rules = array(); |
|
70 | + protected $_config_rules = array(); |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * Array of validation errors |
74 | 74 | * |
75 | 75 | * @var array |
76 | 76 | */ |
77 | - protected $_error_array = array(); |
|
77 | + protected $_error_array = array(); |
|
78 | 78 | |
79 | 79 | /** |
80 | 80 | * Array of custom error messages |
81 | 81 | * |
82 | 82 | * @var array |
83 | 83 | */ |
84 | - protected $_error_messages = array(); |
|
84 | + protected $_error_messages = array(); |
|
85 | 85 | |
86 | 86 | /** |
87 | 87 | * Start tag for error wrapping |
88 | 88 | * |
89 | 89 | * @var string |
90 | 90 | */ |
91 | - protected $_error_prefix = '<p>'; |
|
91 | + protected $_error_prefix = '<p>'; |
|
92 | 92 | |
93 | 93 | /** |
94 | 94 | * End tag for error wrapping |
95 | 95 | * |
96 | 96 | * @var string |
97 | 97 | */ |
98 | - protected $_error_suffix = '</p>'; |
|
98 | + protected $_error_suffix = '</p>'; |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * Custom error message |
102 | 102 | * |
103 | 103 | * @var string |
104 | 104 | */ |
105 | - protected $error_string = ''; |
|
105 | + protected $error_string = ''; |
|
106 | 106 | |
107 | 107 | /** |
108 | 108 | * Whether the form data has been validated as safe |
109 | 109 | * |
110 | 110 | * @var bool |
111 | 111 | */ |
112 | - protected $_safe_form_data = FALSE; |
|
112 | + protected $_safe_form_data = FALSE; |
|
113 | 113 | |
114 | 114 | /** |
115 | 115 | * Custom data to validate |
116 | 116 | * |
117 | 117 | * @var array |
118 | 118 | */ |
119 | - public $validation_data = array(); |
|
119 | + public $validation_data = array(); |
|
120 | 120 | |
121 | 121 | /** |
122 | 122 | * Initialize Form_Validation class |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function __construct($rules = array()) |
128 | 128 | { |
129 | - $this->CI =& get_instance(); |
|
129 | + $this->CI = & get_instance(); |
|
130 | 130 | |
131 | 131 | // applies delimiters set in config file. |
132 | 132 | if (isset($rules['error_prefix'])) |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | { |
509 | 509 | if (is_array($array) && isset($keys[$i])) |
510 | 510 | { |
511 | - return isset($array[$keys[$i]]) ? $this->_reduce_array($array[$keys[$i]], $keys, ($i+1)) : NULL; |
|
511 | + return isset($array[$keys[$i]]) ? $this->_reduce_array($array[$keys[$i]], $keys, ($i + 1)) : NULL; |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | // NULL must be returned for empty fields |
@@ -538,18 +538,18 @@ discard block |
||
538 | 538 | else |
539 | 539 | { |
540 | 540 | // start with a reference |
541 | - $post_ref =& $_POST; |
|
541 | + $post_ref = & $_POST; |
|
542 | 542 | |
543 | 543 | // before we assign values, make a reference to the right POST key |
544 | 544 | if (count($row['keys']) === 1) |
545 | 545 | { |
546 | - $post_ref =& $post_ref[current($row['keys'])]; |
|
546 | + $post_ref = & $post_ref[current($row['keys'])]; |
|
547 | 547 | } |
548 | 548 | else |
549 | 549 | { |
550 | 550 | foreach ($row['keys'] as $val) |
551 | 551 | { |
552 | - $post_ref =& $post_ref[$val]; |
|
552 | + $post_ref = & $post_ref[$val]; |
|
553 | 553 | } |
554 | 554 | } |
555 | 555 |
@@ -202,8 +202,7 @@ discard block |
||
202 | 202 | if ( ! is_string($field) OR $field === '' OR empty($rules)) |
203 | 203 | { |
204 | 204 | return $this; |
205 | - } |
|
206 | - elseif ( ! is_array($rules)) |
|
205 | + } elseif ( ! is_array($rules)) |
|
207 | 206 | { |
208 | 207 | // BC: Convert pipe-separated rules string to an array |
209 | 208 | if ( ! is_string($rules)) |
@@ -460,8 +459,7 @@ discard block |
||
460 | 459 | if ($row['is_array'] === TRUE) |
461 | 460 | { |
462 | 461 | $this->_field_data[$field]['postdata'] = $this->_reduce_array($validation_array, $row['keys']); |
463 | - } |
|
464 | - elseif (isset($validation_array[$field])) |
|
462 | + } elseif (isset($validation_array[$field])) |
|
465 | 463 | { |
466 | 464 | $this->_field_data[$field]['postdata'] = $validation_array[$field]; |
467 | 465 | } |
@@ -534,8 +532,7 @@ discard block |
||
534 | 532 | { |
535 | 533 | $_POST[$row['field']] = $row['postdata']; |
536 | 534 | } |
537 | - } |
|
538 | - else |
|
535 | + } else |
|
539 | 536 | { |
540 | 537 | // start with a reference |
541 | 538 | $post_ref =& $_POST; |
@@ -544,8 +541,7 @@ discard block |
||
544 | 541 | if (count($row['keys']) === 1) |
545 | 542 | { |
546 | 543 | $post_ref =& $post_ref[current($row['keys'])]; |
547 | - } |
|
548 | - else |
|
544 | + } else |
|
549 | 545 | { |
550 | 546 | foreach ($row['keys'] as $val) |
551 | 547 | { |
@@ -562,8 +558,7 @@ discard block |
||
562 | 558 | } |
563 | 559 | |
564 | 560 | $post_ref = $array; |
565 | - } |
|
566 | - else |
|
561 | + } else |
|
567 | 562 | { |
568 | 563 | $post_ref = $row['postdata']; |
569 | 564 | } |
@@ -611,14 +606,12 @@ discard block |
||
611 | 606 | $rules = array(1 => $rule); |
612 | 607 | break; |
613 | 608 | } |
614 | - } |
|
615 | - elseif (is_callable($rule)) |
|
609 | + } elseif (is_callable($rule)) |
|
616 | 610 | { |
617 | 611 | $callback = TRUE; |
618 | 612 | $rules = array(1 => $rule); |
619 | 613 | break; |
620 | - } |
|
621 | - elseif (is_array($rule) && isset($rule[0], $rule[1]) && is_callable($rule[1])) |
|
614 | + } elseif (is_array($rule) && isset($rule[0], $rule[1]) && is_callable($rule[1])) |
|
622 | 615 | { |
623 | 616 | $callback = TRUE; |
624 | 617 | $rules = array(array($rule[0], $rule[1])); |
@@ -644,12 +637,10 @@ discard block |
||
644 | 637 | if (isset($this->_field_data[$row['field']]['errors'][$type])) |
645 | 638 | { |
646 | 639 | $line = $this->_field_data[$row['field']]['errors'][$type]; |
647 | - } |
|
648 | - elseif (isset($this->_error_messages[$type])) |
|
640 | + } elseif (isset($this->_error_messages[$type])) |
|
649 | 641 | { |
650 | 642 | $line = $this->_error_messages[$type]; |
651 | - } |
|
652 | - elseif (FALSE === ($line = $this->CI->lang->line('form_validation_'.$type)) |
|
643 | + } elseif (FALSE === ($line = $this->CI->lang->line('form_validation_'.$type)) |
|
653 | 644 | // DEPRECATED support for non-prefixed keys |
654 | 645 | && FALSE === ($line = $this->CI->lang->line($type, FALSE))) |
655 | 646 | { |
@@ -691,8 +682,7 @@ discard block |
||
691 | 682 | |
692 | 683 | $postdata = $this->_field_data[$row['field']]['postdata'][$cycles]; |
693 | 684 | $_in_array = TRUE; |
694 | - } |
|
695 | - else |
|
685 | + } else |
|
696 | 686 | { |
697 | 687 | // If we get an array field, but it's not expected - then it is most likely |
698 | 688 | // somebody messing with the form on the client side, so we'll just consider |
@@ -711,12 +701,10 @@ discard block |
||
711 | 701 | $rule = substr($rule, 9); |
712 | 702 | $callback = TRUE; |
713 | 703 | } |
714 | - } |
|
715 | - elseif (is_callable($rule)) |
|
704 | + } elseif (is_callable($rule)) |
|
716 | 705 | { |
717 | 706 | $callable = TRUE; |
718 | - } |
|
719 | - elseif (is_array($rule) && isset($rule[0], $rule[1]) && is_callable($rule[1])) |
|
707 | + } elseif (is_array($rule) && isset($rule[0], $rule[1]) && is_callable($rule[1])) |
|
720 | 708 | { |
721 | 709 | // We have a "named" callable, so save the name |
722 | 710 | $callable = $rule[0]; |
@@ -741,14 +729,12 @@ discard block |
||
741 | 729 | { |
742 | 730 | log_message('debug', 'Unable to find callback validation rule: '.$rule); |
743 | 731 | $result = FALSE; |
744 | - } |
|
745 | - else |
|
732 | + } else |
|
746 | 733 | { |
747 | 734 | // Run the function and grab the result |
748 | 735 | $result = $this->CI->$rule($postdata, $param); |
749 | 736 | } |
750 | - } |
|
751 | - else |
|
737 | + } else |
|
752 | 738 | { |
753 | 739 | $result = is_array($rule) |
754 | 740 | ? $rule[0]->{$rule[1]}($postdata) |
@@ -765,8 +751,7 @@ discard block |
||
765 | 751 | if ($_in_array === TRUE) |
766 | 752 | { |
767 | 753 | $this->_field_data[$row['field']]['postdata'][$cycles] = is_bool($result) ? $postdata : $result; |
768 | - } |
|
769 | - else |
|
754 | + } else |
|
770 | 755 | { |
771 | 756 | $this->_field_data[$row['field']]['postdata'] = is_bool($result) ? $postdata : $result; |
772 | 757 | } |
@@ -776,8 +761,7 @@ discard block |
||
776 | 761 | { |
777 | 762 | continue; |
778 | 763 | } |
779 | - } |
|
780 | - elseif ( ! method_exists($this, $rule)) |
|
764 | + } elseif ( ! method_exists($this, $rule)) |
|
781 | 765 | { |
782 | 766 | // If our own wrapper function doesn't exist we see if a native PHP function does. |
783 | 767 | // Users can use any native PHP function call that has one param. |
@@ -789,27 +773,23 @@ discard block |
||
789 | 773 | if ($_in_array === TRUE) |
790 | 774 | { |
791 | 775 | $this->_field_data[$row['field']]['postdata'][$cycles] = is_bool($result) ? $postdata : $result; |
792 | - } |
|
793 | - else |
|
776 | + } else |
|
794 | 777 | { |
795 | 778 | $this->_field_data[$row['field']]['postdata'] = is_bool($result) ? $postdata : $result; |
796 | 779 | } |
797 | - } |
|
798 | - else |
|
780 | + } else |
|
799 | 781 | { |
800 | 782 | log_message('debug', 'Unable to find validation rule: '.$rule); |
801 | 783 | $result = FALSE; |
802 | 784 | } |
803 | - } |
|
804 | - else |
|
785 | + } else |
|
805 | 786 | { |
806 | 787 | $result = $this->$rule($postdata, $param); |
807 | 788 | |
808 | 789 | if ($_in_array === TRUE) |
809 | 790 | { |
810 | 791 | $this->_field_data[$row['field']]['postdata'][$cycles] = is_bool($result) ? $postdata : $result; |
811 | - } |
|
812 | - else |
|
792 | + } else |
|
813 | 793 | { |
814 | 794 | $this->_field_data[$row['field']]['postdata'] = is_bool($result) ? $postdata : $result; |
815 | 795 | } |
@@ -827,8 +807,7 @@ discard block |
||
827 | 807 | elseif (isset($this->_field_data[$row['field']]['errors'][$rule])) |
828 | 808 | { |
829 | 809 | $line = $this->_field_data[$row['field']]['errors'][$rule]; |
830 | - } |
|
831 | - elseif ( ! isset($this->_error_messages[$rule])) |
|
810 | + } elseif ( ! isset($this->_error_messages[$rule])) |
|
832 | 811 | { |
833 | 812 | if (FALSE === ($line = $this->CI->lang->line('form_validation_'.$rule)) |
834 | 813 | // DEPRECATED support for non-prefixed keys |
@@ -836,8 +815,7 @@ discard block |
||
836 | 815 | { |
837 | 816 | $line = $this->CI->lang->line('form_validation_error_message_not_set').'('.$rule.')'; |
838 | 817 | } |
839 | - } |
|
840 | - else |
|
818 | + } else |
|
841 | 819 | { |
842 | 820 | $line = $this->_error_messages[$rule]; |
843 | 821 | } |
@@ -984,8 +962,7 @@ discard block |
||
984 | 962 | } |
985 | 963 | |
986 | 964 | return ''; |
987 | - } |
|
988 | - elseif (($field === '' OR $value === '') OR ($field !== $value)) |
|
965 | + } elseif (($field === '' OR $value === '') OR ($field !== $value)) |
|
989 | 966 | { |
990 | 967 | return ''; |
991 | 968 | } |
@@ -1027,8 +1004,7 @@ discard block |
||
1027 | 1004 | } |
1028 | 1005 | |
1029 | 1006 | return ''; |
1030 | - } |
|
1031 | - elseif (($field === '' OR $value === '') OR ($field !== $value)) |
|
1007 | + } elseif (($field === '' OR $value === '') OR ($field !== $value)) |
|
1032 | 1008 | { |
1033 | 1009 | return ''; |
1034 | 1010 | } |
@@ -1202,14 +1178,12 @@ discard block |
||
1202 | 1178 | if (empty($str)) |
1203 | 1179 | { |
1204 | 1180 | return FALSE; |
1205 | - } |
|
1206 | - elseif (preg_match('/^(?:([^:]*)\:)?\/\/(.+)$/', $str, $matches)) |
|
1181 | + } elseif (preg_match('/^(?:([^:]*)\:)?\/\/(.+)$/', $str, $matches)) |
|
1207 | 1182 | { |
1208 | 1183 | if (empty($matches[2])) |
1209 | 1184 | { |
1210 | 1185 | return FALSE; |
1211 | - } |
|
1212 | - elseif ( ! in_array($matches[1], array('http', 'https'), TRUE)) |
|
1186 | + } elseif ( ! in_array($matches[1], array('http', 'https'), TRUE)) |
|
1213 | 1187 | { |
1214 | 1188 | return FALSE; |
1215 | 1189 | } |
@@ -1,40 +1,40 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CodeIgniter |
|
4 | - * |
|
5 | - * An open source application development framework for PHP |
|
6 | - * |
|
7 | - * This content is released under the MIT License (MIT) |
|
8 | - * |
|
9 | - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | - * |
|
11 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | - * of this software and associated documentation files (the "Software"), to deal |
|
13 | - * in the Software without restriction, including without limitation the rights |
|
14 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | - * copies of the Software, and to permit persons to whom the Software is |
|
16 | - * furnished to do so, subject to the following conditions: |
|
17 | - * |
|
18 | - * The above copyright notice and this permission notice shall be included in |
|
19 | - * all copies or substantial portions of the Software. |
|
20 | - * |
|
21 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | - * THE SOFTWARE. |
|
28 | - * |
|
29 | - * @package CodeIgniter |
|
30 | - * @author EllisLab Dev Team |
|
31 | - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | - * @license http://opensource.org/licenses/MIT MIT License |
|
34 | - * @link http://codeigniter.com |
|
35 | - * @since Version 1.0.0 |
|
36 | - * @filesource |
|
37 | - */ |
|
3 | + * CodeIgniter |
|
4 | + * |
|
5 | + * An open source application development framework for PHP |
|
6 | + * |
|
7 | + * This content is released under the MIT License (MIT) |
|
8 | + * |
|
9 | + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology |
|
10 | + * |
|
11 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
12 | + * of this software and associated documentation files (the "Software"), to deal |
|
13 | + * in the Software without restriction, including without limitation the rights |
|
14 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
15 | + * copies of the Software, and to permit persons to whom the Software is |
|
16 | + * furnished to do so, subject to the following conditions: |
|
17 | + * |
|
18 | + * The above copyright notice and this permission notice shall be included in |
|
19 | + * all copies or substantial portions of the Software. |
|
20 | + * |
|
21 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
22 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
23 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
24 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
25 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
26 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
27 | + * THE SOFTWARE. |
|
28 | + * |
|
29 | + * @package CodeIgniter |
|
30 | + * @author EllisLab Dev Team |
|
31 | + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
|
32 | + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) |
|
33 | + * @license http://opensource.org/licenses/MIT MIT License |
|
34 | + * @link http://codeigniter.com |
|
35 | + * @since Version 1.0.0 |
|
36 | + * @filesource |
|
37 | + */ |
|
38 | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
39 | 39 | |
40 | 40 | /** |
@@ -675,6 +675,7 @@ |
||
675 | 675 | * |
676 | 676 | * @param string The element to attach the event to |
677 | 677 | * @param bool If a CDATA section should be added |
678 | + * @param string $script |
|
678 | 679 | * @return string |
679 | 680 | */ |
680 | 681 | public function inline($script, $cdata = TRUE) |
@@ -78,12 +78,12 @@ |
||
78 | 78 | |
79 | 79 | extract($defaults); |
80 | 80 | |
81 | - $this->CI =& get_instance(); |
|
81 | + $this->CI = & get_instance(); |
|
82 | 82 | |
83 | 83 | // load the requested js library |
84 | 84 | $this->CI->load->library('Javascript/'.$js_library_driver, array('autoload' => $autoload)); |
85 | 85 | // make js to refer to current library |
86 | - $this->js =& $this->CI->$js_library_driver; |
|
86 | + $this->js = & $this->CI->$js_library_driver; |
|
87 | 87 | |
88 | 88 | log_message('info', 'Javascript Class Initialized and loaded. Driver used: '.$js_library_driver); |
89 | 89 | } |
@@ -644,8 +644,7 @@ discard block |
||
644 | 644 | if ($external_file !== '') |
645 | 645 | { |
646 | 646 | $this->_javascript_location = $external_file; |
647 | - } |
|
648 | - elseif ($this->CI->config->item('javascript_location') !== '') |
|
647 | + } elseif ($this->CI->config->item('javascript_location') !== '') |
|
649 | 648 | { |
650 | 649 | $this->_javascript_location = $this->CI->config->item('javascript_location'); |
651 | 650 | } |
@@ -653,12 +652,10 @@ discard block |
||
653 | 652 | if ($relative === TRUE OR strpos($external_file, 'http://') === 0 OR strpos($external_file, 'https://') === 0) |
654 | 653 | { |
655 | 654 | $str = $this->_open_script($external_file); |
656 | - } |
|
657 | - elseif (strpos($this->_javascript_location, 'http://') !== FALSE) |
|
655 | + } elseif (strpos($this->_javascript_location, 'http://') !== FALSE) |
|
658 | 656 | { |
659 | 657 | $str = $this->_open_script($this->_javascript_location.$external_file); |
660 | - } |
|
661 | - else |
|
658 | + } else |
|
662 | 659 | { |
663 | 660 | $str = $this->_open_script($this->CI->config->slash_item('base_url').$this->_javascript_location.$external_file); |
664 | 661 | } |
@@ -754,17 +751,14 @@ discard block |
||
754 | 751 | if (is_object($result)) |
755 | 752 | { |
756 | 753 | $json_result = is_callable(array($result, 'result_array')) ? $result->result_array() : (array) $result; |
757 | - } |
|
758 | - elseif (is_array($result)) |
|
754 | + } elseif (is_array($result)) |
|
759 | 755 | { |
760 | 756 | $json_result = $result; |
761 | - } |
|
762 | - else |
|
757 | + } else |
|
763 | 758 | { |
764 | 759 | return $this->_prep_args($result); |
765 | 760 | } |
766 | - } |
|
767 | - else |
|
761 | + } else |
|
768 | 762 | { |
769 | 763 | return 'null'; |
770 | 764 | } |
@@ -775,8 +769,7 @@ discard block |
||
775 | 769 | if ( ! is_array($json_result) && empty($json_result)) |
776 | 770 | { |
777 | 771 | show_error('Generate JSON Failed - Illegal key, value pair.'); |
778 | - } |
|
779 | - elseif ($match_array_type) |
|
772 | + } elseif ($match_array_type) |
|
780 | 773 | { |
781 | 774 | $_is_assoc = $this->_is_associative_array($json_result); |
782 | 775 | } |
@@ -786,8 +779,7 @@ discard block |
||
786 | 779 | if ($_is_assoc) |
787 | 780 | { |
788 | 781 | $json[] = $this->_prep_args($k, TRUE).':'.$this->generate_json($v, $match_array_type); |
789 | - } |
|
790 | - else |
|
782 | + } else |
|
791 | 783 | { |
792 | 784 | $json[] = $this->generate_json($v, $match_array_type); |
793 | 785 | } |
@@ -838,16 +830,13 @@ discard block |
||
838 | 830 | if ($result === NULL) |
839 | 831 | { |
840 | 832 | return 'null'; |
841 | - } |
|
842 | - elseif (is_bool($result)) |
|
833 | + } elseif (is_bool($result)) |
|
843 | 834 | { |
844 | 835 | return ($result === TRUE) ? 'true' : 'false'; |
845 | - } |
|
846 | - elseif (is_string($result) OR $is_key) |
|
836 | + } elseif (is_string($result) OR $is_key) |
|
847 | 837 | { |
848 | 838 | return '"'.str_replace(array('\\', "\t", "\n", "\r", '"', '/'), array('\\\\', '\\t', '\\n', "\\r", '\"', '\/'), $result).'"'; |
849 | - } |
|
850 | - elseif (is_scalar($result)) |
|
839 | + } elseif (is_scalar($result)) |
|
851 | 840 | { |
852 | 841 | return $result; |
853 | 842 | } |