@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | $result_message = 'Email Send Failed'; |
| 26 | 26 | |
| 27 | - foreach ($recipients AS $recipient) { |
|
| 27 | + foreach ($recipients as $recipient) { |
|
| 28 | 28 | |
| 29 | 29 | $mail->Subject = $subject; |
| 30 | 30 | $mail->Body = $message_html; |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | class Sanitize |
| 5 | 5 | { |
| 6 | 6 | |
| 7 | - public function text($text) |
|
| 7 | + public function text($text) |
|
| 8 | 8 | { |
| 9 | 9 | return htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); |
| 10 | 10 | |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | { |
| 6 | 6 | |
| 7 | 7 | public function text($text) |
| 8 | - { |
|
| 8 | + { |
|
| 9 | 9 | return htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); |
| 10 | 10 | |
| 11 | 11 | } |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | class Unsanitize |
| 5 | 5 | { |
| 6 | 6 | |
| 7 | - public function text($text) |
|
| 7 | + public function text($text) |
|
| 8 | 8 | { |
| 9 | 9 | return htmlspecialchars_decode($text, ENT_QUOTES); |
| 10 | 10 | |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | { |
| 6 | 6 | |
| 7 | 7 | public function text($text) |
| 8 | - { |
|
| 8 | + { |
|
| 9 | 9 | return htmlspecialchars_decode($text, ENT_QUOTES); |
| 10 | 10 | |
| 11 | 11 | } |
@@ -19,7 +19,9 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public function getConvRate($from_currency, $to_currency) |
| 21 | 21 | { |
| 22 | - if ($from_currency == $to_currency) return 1.0; |
|
| 22 | + if ($from_currency == $to_currency) { |
|
| 23 | + return 1.0; |
|
| 24 | + } |
|
| 23 | 25 | |
| 24 | 26 | $conversion_rate = 0.0; |
| 25 | 27 | |
@@ -28,7 +30,9 @@ discard block |
||
| 28 | 30 | $full_url = 'http://api.exchangeratesapi.io/v1/convert?access_key=' . $this->api_key . '&from=' . $from_currency . '&to=' . $to_currency; |
| 29 | 31 | $remote = new Remote(); |
| 30 | 32 | $result = $remote->getFileContents($full_url); |
| 31 | - if ($result === false) return false; |
|
| 33 | + if ($result === false) { |
|
| 34 | + return false; |
|
| 35 | + } |
|
| 32 | 36 | $json_result = json_decode($result, true); |
| 33 | 37 | $conversion_rate = $json_result['rates'][$to_currency]; |
| 34 | 38 | |
@@ -37,7 +41,9 @@ discard block |
||
| 37 | 41 | $full_url = 'https://v6.exchangerate-api.com/v6/' . $this->api_key . '/pair/' . $from_currency . '/' . $to_currency; |
| 38 | 42 | $remote = new Remote(); |
| 39 | 43 | $result = $remote->getFileContents($full_url); |
| 40 | - if ($result === false) return false; |
|
| 44 | + if ($result === false) { |
|
| 45 | + return false; |
|
| 46 | + } |
|
| 41 | 47 | $json_result = json_decode($result, true); |
| 42 | 48 | $conversion_rate = $json_result['conversion_rate']; |
| 43 | 49 | |
@@ -46,7 +52,9 @@ discard block |
||
| 46 | 52 | $full_url = 'http://data.fixer.io/api/convert?access_key=' . $this->api_key . '&from=' . $from_currency . '&to=' . $to_currency; |
| 47 | 53 | $remote = new Remote(); |
| 48 | 54 | $result = $remote->getFileContents($full_url); |
| 49 | - if ($result === false) return false; |
|
| 55 | + if ($result === false) { |
|
| 56 | + return false; |
|
| 57 | + } |
|
| 50 | 58 | $json_result = json_decode($result, true); |
| 51 | 59 | $conversion_rate = $json_result['rates'][$to_currency]; |
| 52 | 60 | |
@@ -55,7 +63,9 @@ discard block |
||
| 55 | 63 | $full_url = 'https://api.interzoid.com/convertcurrency?license=' . $this->api_key . '&from=' . $from_currency . '&to=' . $to_currency . '&amount=1'; |
| 56 | 64 | $remote = new Remote(); |
| 57 | 65 | $result = $remote->getFileContents($full_url); |
| 58 | - if ($result === false) return false; |
|
| 66 | + if ($result === false) { |
|
| 67 | + return false; |
|
| 68 | + } |
|
| 59 | 69 | $json_result = json_decode($result, true); |
| 60 | 70 | $conversion_rate = $json_result['Converted']; |
| 61 | 71 | |
@@ -64,7 +74,9 @@ discard block |
||
| 64 | 74 | $full_url = 'https://api.exchangerate.host/convert?from=' . $from_currency . '&to=' . $to_currency; |
| 65 | 75 | $remote = new Remote(); |
| 66 | 76 | $result = $remote->getFileContents($full_url); |
| 67 | - if ($result === false) return false; |
|
| 77 | + if ($result === false) { |
|
| 78 | + return false; |
|
| 79 | + } |
|
| 68 | 80 | $json_result = json_decode($result, true); |
| 69 | 81 | $conversion_rate = $json_result['info']['rate']; |
| 70 | 82 | |
@@ -8,12 +8,24 @@ |
||
| 8 | 8 | // The order of the below user agent checks matters |
| 9 | 9 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#browser_name |
| 10 | 10 | $agent_string = strtolower($_SERVER['HTTP_USER_AGENT']); |
| 11 | - if (strpos($agent_string, 'chromium')) return 'chromium'; |
|
| 12 | - if (strpos($agent_string, 'opr/')) return 'opera'; |
|
| 13 | - if (strpos($agent_string, 'chrome')) return 'chrome'; |
|
| 14 | - if (strpos($agent_string, 'seamonkey')) return 'seamonkey'; |
|
| 15 | - if (strpos($agent_string, 'firefox')) return 'firefox'; |
|
| 16 | - if (strpos($agent_string, 'version/')) return 'safari'; |
|
| 11 | + if (strpos($agent_string, 'chromium')) { |
|
| 12 | + return 'chromium'; |
|
| 13 | + } |
|
| 14 | + if (strpos($agent_string, 'opr/')) { |
|
| 15 | + return 'opera'; |
|
| 16 | + } |
|
| 17 | + if (strpos($agent_string, 'chrome')) { |
|
| 18 | + return 'chrome'; |
|
| 19 | + } |
|
| 20 | + if (strpos($agent_string, 'seamonkey')) { |
|
| 21 | + return 'seamonkey'; |
|
| 22 | + } |
|
| 23 | + if (strpos($agent_string, 'firefox')) { |
|
| 24 | + return 'firefox'; |
|
| 25 | + } |
|
| 26 | + if (strpos($agent_string, 'version/')) { |
|
| 27 | + return 'safari'; |
|
| 28 | + } |
|
| 17 | 29 | return ''; |
| 18 | 30 | } |
| 19 | 31 | |