Skip to content

Commit 0d89549

Browse files
committed
- upgrade 3rd party packages and php to 8.4
1 parent a3dbfe7 commit 0d89549

File tree

8 files changed

+60
-47
lines changed

8 files changed

+60
-47
lines changed

php/Mobile_Detect.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,9 @@ public function match($regex, $userAgent = '')
10521052
if( !is_null($userAgent) ) {
10531053
$webAgent = (!empty($userAgent) ? $userAgent : $this->userAgent);
10541054
}
1055+
if( is_null($webAgent) ) {
1056+
$webAgent = '';
1057+
}
10551058

10561059
return (bool) preg_match('/'.$regex.'/is', $webAgent );
10571060
}

php/composer.json

100644100755
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,34 @@
1212
}
1313
],
1414
"support": {
15-
"email": "mark@vsoft.solutions",
16-
"irc": "irc://irc.freenode.org/composer"
15+
"email": "mark@vsoft.solutions"
1716
},
1817

1918
"require-dev": {
2019
"phpmd/phpmd" : "@stable",
21-
"phpunit/phpunit": "^5.7 || >=9.2",
22-
"misantron/dbunit": ">=5.2.1",
23-
"phpunit/php-code-coverage": "^4.0 || >= 5.3",
20+
"phpunit/phpunit": "^5.7 || >=11.5.15",
21+
"phpunit/php-code-coverage": "^4.0 || >= 11.0.9",
22+
"misantron/dbunit": ">=5.4.0",
2423
"ext-xdebug" : "*",
25-
"phpunit/php-invoker": ">=1.1.4 || ^2.0"
24+
"phpunit/php-invoker": ">=1.1.4 || ^6.0.0"
2625
},
2726

2827
"require": {
29-
"php": "^7.1 || ^8.0",
30-
"monolog/monolog": "^2.8.0",
31-
"firebase/php-jwt": "^6.3.1",
32-
"kreait/firebase-php": "^6.9.3",
33-
"html2text/html2text": "^4.3.1",
34-
"mikecao/flight": "^2.0.1",
35-
"phpmailer/phpmailer": "^6.7.1",
36-
"plivo/plivo-php": "^4.37.1",
28+
"php": "^7.1 || ^8.3",
29+
"monolog/monolog": "^3.9.0",
30+
"firebase/php-jwt": "^6.11.0",
31+
"kreait/firebase-php": "^7.18.0",
32+
"html2text/html2text": "^4.3.2",
33+
"mikecao/flight": "^3.15.2",
34+
"phpmailer/phpmailer": "^6.9.3",
35+
"plivo/plivo-php": "^4.66.6",
3736
"phpsms/phpsms": "dev-master",
38-
"twilio/sdk": "^6.43.4",
39-
"twig/twig": "^2.15.3",
40-
"twig/extensions": "^1.x-dev",
41-
"spomky-labs/otphp": "^11.1.0",
42-
"geoip2/geoip2": "^2.13.0",
37+
"twilio/sdk": "^8.4.1",
38+
"twig/twig": "^3.x-dev",
39+
"spomky-labs/otphp": "^11.3.0",
40+
"geoip2/geoip2": "^3.1.0",
4341
"ua-parser/uap-php": "^3.9.14",
44-
"aws/aws-sdk-php": "^3.252.6"
42+
"aws/aws-sdk-php": "^3.342.20"
4543
},
4644

4745
"repositories": [

php/email_polling.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
require_once 'logging.php';
2525

2626
interface IMapProvider {
27-
public function imap_open($mailbox, $username, $password, $options = null, $n_retries = null);
27+
public function imap_open($mailbox, $username, $password, $options = 0, $n_retries = null);
2828

2929
public function imap_last_error();
3030

@@ -36,23 +36,23 @@ public function imap_expunge($imap_stream);
3636

3737
public function imap_close($imap_stream, $flag = null);
3838

39-
public function imap_fetchstructure($imap_stream, $msg_number, $options = null);
39+
public function imap_fetchstructure($imap_stream, $msg_number, $options = 0);
4040

41-
public function imap_fetchbody($imap_stream, $msg_number, $section, $options = null);
41+
public function imap_fetchbody($imap_stream, $msg_number, $section, $options = 0);
4242

43-
public function imap_body($imap_stream, $msg_number, $options = null);
43+
public function imap_body($imap_stream, $msg_number, $options = 0);
4444

4545
public function imap_8bit($string);
4646

4747
public function imap_base64($text);
4848

4949
public function imap_qprint($string);
5050

51-
public function imap_delete($imap_stream, $msg_number, $options = null);
51+
public function imap_delete($imap_stream, $msg_number, $options = 0);
5252
}
5353

5454
class IMapProviderDefault implements IMapProvider {
55-
public function imap_open($mailbox, $username, $password, $options = null, $n_retries = null) {
55+
public function imap_open($mailbox, $username, $password, $options = 0, $n_retries = 0) {
5656
return \imap_open($mailbox, $username, $password, $options, $n_retries);
5757
}
5858

@@ -80,7 +80,7 @@ public function imap_fetchstructure($imap_stream, $msg_number, $options = 0) {
8080
return \imap_fetchstructure($imap_stream, $msg_number, $options);
8181
}
8282

83-
public function imap_fetchbody($imap_stream, $msg_number, $section, $options = null) {
83+
public function imap_fetchbody($imap_stream, $msg_number, $section, $options = 0) {
8484
return \imap_fetchbody($imap_stream, $msg_number, $section, $options);
8585
}
8686

@@ -100,7 +100,7 @@ public function imap_qprint($string) {
100100
return \imap_qprint($string);
101101
}
102102

103-
public function imap_delete($imap_stream, $msg_number, $options = null) {
103+
public function imap_delete($imap_stream, $msg_number, $options = 0) {
104104
return \imap_delete($imap_stream, $msg_number, $options);
105105
}
106106
}

php/plugins/sms-callout/default.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ public function getSMSForRecipientWithCustomWebRootURL($user_id, $smsText, $smsW
185185
$longUrlStart = strpos($smsText ?? '', $shortenStartTag);
186186
$longUrlEnd = strpos($smsText ?? '', $shortenEndTag);
187187
$longUrlLen = $longUrlEnd-($longUrlStart+strlen($shortenStartTag));
188-
$longUrl = substr($smsText, $longUrlStart+strlen($shortenStartTag), $longUrlLen);
188+
189+
$longUrl = $smsText;
190+
if($longUrlStart != false && $longUrlEnd != false) {
191+
$longUrl = substr($smsText, $longUrlStart+strlen($shortenStartTag), $longUrlLen);
192+
}
189193

190194
if($smsWebRootOverride !== null && array_key_exists($user_id, $smsWebRootOverride)) {
191195
$shortUrl = $smsWebRootOverride[$user_id];
@@ -198,7 +202,9 @@ public function getSMSForRecipientWithCustomWebRootURL($user_id, $smsText, $smsW
198202
$log->trace("Callout URL webroot old [$longUrl] new [$shortUrl]");
199203
}
200204

201-
$smsText = substr_replace($smsText, $shortUrl, $longUrlStart, $longUrlLen+strlen($shortenStartTag)+strlen($shortenEndTag));
205+
if($longUrlStart != false && $longUrlEnd != false) {
206+
$smsText = substr_replace($smsText, $shortUrl, $longUrlStart, $longUrlLen+strlen($shortenStartTag)+strlen($shortenEndTag));
207+
}
202208
return $smsText;
203209
}
204210

php/template.php

100644100755
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
require_once 'config_constants.php';
99
require __DIR__ . '/vendor/autoload.php';
1010

11-
use Twig\Extensions\TextExtension;
11+
//use Twig\Extensions\TextExtension;
1212

1313
class RiprunnerTwig {
1414

@@ -17,7 +17,7 @@ class RiprunnerTwig {
1717

1818
public function getLoader() {
1919
if($this->twig_template_loader === null) {
20-
$this->twig_template_loader = new \Twig_Loader_Filesystem(
20+
$this->twig_template_loader = new \Twig\Loader\FilesystemLoader(
2121
__RIPRUNNER_ROOT__ . '/views');
2222
// This allows customized views to be placed in the folder below
2323
if(file_exists(__RIPRUNNER_ROOT__ . '/views-custom') === true) {
@@ -28,12 +28,12 @@ public function getLoader() {
2828
}
2929
public function getEnvironment() {
3030
if($this->twig === null) {
31-
$this->twig = new \Twig_Environment($this->getLoader(), array(
31+
$this->twig = new \Twig\Environment($this->getLoader(), array(
3232
'cache' => __RIPRUNNER_ROOT__ . '/temp/twig',
3333
'debug' => true,
3434
'strict_variables' => true
3535
));
36-
$this->twig->addExtension(new TextExtension());
36+
//$this->twig->addExtension(new TextExtension());
3737
}
3838
return $this->twig;
3939
}

php/views/callout-audit.twig.html

100644100755
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,23 @@
7979
{% if callout_audit_vm.callout_details_responding_cols is defined %}
8080
<thead>
8181
<tr>
82-
{% for col_name in callout_audit_vm.callout_details_responding_cols
83-
if col_name != 'id' and
82+
{% for col_name in callout_audit_vm.callout_details_responding_cols %}
83+
{% if col_name != 'id' and
8484
col_name != 'calloutid' and
8585
col_name != 'useracctid' and
8686
col_name != 'responder_location' and
8787
col_name != 'firehall_location' and
8888
col_name != 'responder_display_status' %}
8989
<th scope="col">{{ col_name }}</th>
90+
{% endif %}
9091
{% endfor %}
9192
</tr>
9293
</thead>
9394

9495
{% for row in callout_audit_vm.callout_details_responding_list %}
9596
<tr>
96-
{% for col_name in callout_audit_vm.callout_details_responding_cols
97-
if col_name != 'id' and
97+
{% for col_name in callout_audit_vm.callout_details_responding_cols %}
98+
{% if col_name != 'id' and
9899
col_name != 'calloutid' and
99100
col_name != 'useracctid' and
100101
col_name != 'responder_location' and
@@ -121,6 +122,7 @@
121122
{% else %}
122123
<td>{{ row[col_name] }}</td>
123124
{% endif %}
125+
{% endif %}
124126
{% endfor %}
125127
</tr>
126128

php/views/callout-history-response.twig.html

100644100755
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,21 @@
6161
{% if response_history_vm.response_cols is defined %}
6262
<thead>
6363
<tr>
64-
{% for col_name in response_history_vm.response_cols
65-
if col_name != 'address' and
64+
{% for col_name in response_history_vm.response_cols %}
65+
{% if col_name != 'address' and
6666
col_name != 'responder_origin' and
6767
col_name != 'callout_address_dest' and
6868
col_name != 'callout_status_desc' %}
6969
<th scope="col">{{ col_name }}</th>
70+
{% endif %}
7071
{% endfor %}
7172
</tr>
7273
</thead>
7374

7475
{% for row in response_history_vm.response_list %}
7576
<tr>
76-
{% for col_name in response_history_vm.response_cols
77-
if col_name != 'address' and
77+
{% for col_name in response_history_vm.response_cols %}
78+
{% if col_name != 'address' and
7879
col_name != 'responder_origin' and
7980
col_name != 'callout_address_dest' and
8081
col_name != 'callout_status_desc' %}
@@ -99,6 +100,7 @@
99100
{% else %}
100101
<td>{{ row[col_name] }}</td>
101102
{% endif %}
103+
{% endif %}
102104
{% endfor %}
103105
</tr>
104106

php/views/callout-history.twig.html

100644100755
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
{% if callout_history_vm.callout_cols is defined %}
6060
<thead>
6161
<tr>
62-
{% for col_name in callout_history_vm.callout_cols
63-
if col_name != 'callout_type_desc' and
62+
{% for col_name in callout_history_vm.callout_cols %}
63+
{% if col_name != 'callout_type_desc' and
6464
col_name != 'callout_address_origin' and
6565
col_name != 'callout_address_dest' and
6666
col_name != 'callout_status_desc' and
@@ -75,6 +75,7 @@
7575
{% else %}
7676
<th scope="col">{{ col_name }}</th>
7777
{% endif %}
78+
{% endif %}
7879
{% endfor %}
7980
<th scope="col">call audit</th>
8081
<th scope="col">call details</th>
@@ -87,14 +88,14 @@
8788
{% for row in callout_history_vm.callout_list %}
8889
<tr>
8990

90-
{% for col_name in callout_history_vm.callout_cols
91-
if col_name != 'callout_type_desc' and
91+
{% for col_name in callout_history_vm.callout_cols %}
92+
{% if col_name != 'callout_type_desc' and
9293
col_name != 'callout_address_origin' and
9394
col_name != 'callout_address_dest' and
9495
col_name != 'callout_status_desc' and
9596
col_name != 'latitude' and
9697
col_name != 'longitude' and
97-
col_name != 'call_key'%}
98+
col_name != 'call_key' %}
9899

99100
{% if col_name == 'calltype' %}
100101
<td title='{{ row.callout_type_desc }}'>{{ row[col_name] }}</td>
@@ -121,6 +122,7 @@
121122
{% else %}
122123
<td>{{ row[col_name] }}</td>
123124
{% endif %}
125+
{% endif %}
124126
{% endfor %}
125127

126128
<td class="column_nowrap">

0 commit comments

Comments
 (0)