19
19
* PHP 5.3.0 or higher is supported.
20
20
*
21
21
* @author Andre Liechti (SysCo systemes de communication sa) <info@multiotp.net>
22
- * @version 1.0.7
22
+ * @version 1.0.8
23
23
* @date 2023-03-30
24
24
* @since 2022-09-10
25
25
* @copyright (c) 2022-2023 SysCo systemes de communication sa
@@ -421,7 +421,7 @@ public function handleMessages(
421
421
$ post_data
422
422
) {
423
423
$ result_array = array ();
424
- $ extract_data = json_decode ($ post_data , true );
424
+ $ extract_data = json_decode (str_replace ( chr ( 13 ), "" , $ post_data) , true );
425
425
if (null != $ extract_data ) {
426
426
if (isset ($ extract_data ["messages " ])) {
427
427
foreach ($ extract_data ["messages " ] as $ message ) {
@@ -457,15 +457,15 @@ public function handleUpdates(
457
457
$ post_data
458
458
) {
459
459
$ result_array = array ();
460
- $ extract_data = json_decode ($ post_data , true );
460
+ $ extract_data = json_decode (str_replace ( chr ( 13 ), "" , $ post_data) , true );
461
461
if (null != $ extract_data ) {
462
462
if (isset ($ extract_data ["updates " ])) {
463
463
foreach ($ extract_data ["updates " ] as $ update ) {
464
464
if (isset ($ update ["id " ])) {
465
465
if (isset ($ update ["status " ])) {
466
466
$ message_array = glob ($ this ->getDevicePathSend () . $ update ["id " ] . ".* " );
467
467
if (1 == count ($ message_array )) {
468
- $ extract_data = json_decode (file_get_contents ($ message_array [0 ]), true );
468
+ $ extract_data = json_decode (str_replace ( chr ( 13 ), "" , file_get_contents ($ message_array [0 ]) ), true );
469
469
$ content = "" ;
470
470
$ to = "" ;
471
471
if (null != $ extract_data ) {
@@ -481,6 +481,7 @@ public function handleUpdates(
481
481
]);
482
482
$ updated_message = $ this ->getDevicePathSend () . $ update ["id " ] . ". " . $ update ["status " ];
483
483
rename ($ message_array [0 ], $ updated_message );
484
+ touch ($ updated_message );
484
485
}
485
486
}
486
487
}
0 commit comments