@@ -17,15 +17,13 @@ public function get_user_chat_id()
1717 //$this->checkCSRFParam();
1818 $ apikey = $ this ->userMetadataModel ->get ($ user ['id ' ], 'telegram_apikey ' , $ this ->configModel ->get ('telegram_apikey ' ));
1919 $ bot_username = $ this ->userMetadataModel ->get ($ user ['id ' ], 'telegram_username ' , $ this ->configModel ->get ('telegram_username ' ));
20+
21+ // Preventing "A non-numeric value encountered in /var/www/app/plugins/Telegram/Controller/TelegramController.php"
2022 try {
2123 $ offset = 0 + (int )$ this ->userMetadataModel ->get ($ user ['id ' ], 'telegram_offset ' , $ this ->configModel ->get ('telegram_offset ' ));
2224 } catch (Exception $ e ) {
2325 $ offset =0 ;
2426 }
25-
26- // Preventing "A non-numeric value encountered in /var/www/app/plugins/Telegram/Controller/TelegramController.php"
27-
28- $ offset = 0 + $ this ->userMetadataModel ->get ($ user ['id ' ], 'telegram_offset ' , $ this ->configModel ->get ('telegram_offset ' ));
2927 $ private_message = mb_substr (urldecode ($ this ->request ->getStringParam ('private_message ' )), 0 , 32 );
3028
3129 list ($ offset , $ chat_id , $ user_name ) = $ this ->get_chat_id ($ apikey , $ bot_username , $ offset , $ private_message );
@@ -49,7 +47,14 @@ public function get_project_chat_id()
4947 //$this->checkCSRFParam();
5048 $ apikey = $ this ->projectMetadataModel ->get ($ project ['id ' ], 'telegram_apikey ' , $ this ->configModel ->get ('telegram_apikey ' ));
5149 $ bot_username = $ this ->projectMetadataModel ->get ($ project ['id ' ], 'telegram_username ' , $ this ->configModel ->get ('telegram_username ' ));
52- $ offset = 0 + $ this ->projectMetadataModel ->get ($ project ['id ' ], 'telegram_offset ' , $ this ->configModel ->get ('telegram_offset ' ));
50+
51+ // Preventing "A non-numeric value encountered in /var/www/app/plugins/Telegram/Controller/TelegramController.php"
52+ try {
53+ $ offset = 0 + (int )$ this ->projectMetadataModel ->get ($ project ['id ' ], 'telegram_offset ' , $ this ->configModel ->get ('telegram_offset ' ));
54+ } catch (Exception $ e ) {
55+ $ offset =0 ;
56+ }
57+
5358 $ private_message = mb_substr (urldecode ($ this ->request ->getStringParam ('private_message ' )), 0 , 32 );
5459
5560 list ($ offset , $ chat_id , $ user_name ) = $ this ->get_chat_id ($ apikey , $ bot_username , $ offset , $ private_message );
0 commit comments