From f5bc9ac37883ec7eda073f46a28c35a861df0867 Mon Sep 17 00:00:00 2001 From: Irshad Ahmad <94346512+irshadahmad21@users.noreply.github.com> Date: Thu, 5 Jan 2023 18:23:25 +0530 Subject: [PATCH] Fix PHP warning when not using message thread ID (#46) * Update wptelegram-bot-api * Fix PHP warning when not using message thread ID * Prepare for v3.1.15 Co-authored-by: irshadahmad21 --- README.md | 2 +- changelog.md | 6 ++++++ composer.json | 2 +- package.json | 2 +- src/README.txt | 5 ++++- src/changelog.md | 6 ++++++ src/includes/wptelegram-bot-api | 2 +- src/languages/wptelegram.pot | 6 +++--- src/modules/p2tg/PostSender.php | 2 +- src/wptelegram.php | 4 ++-- 10 files changed, 26 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1b7e985..d09b18e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ **Requires at least:** 5.8 **Requires PHP:** 7.0 **Tested up to:** 6.1.1 -**Stable tag:** 3.1.14 +**Stable tag:** 3.1.15 **License:** GPLv2 or later **License URI:** [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html) diff --git a/changelog.md b/changelog.md index fa0e943..3b240cb 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,12 @@ All notable changes to this project are documented in this file. ## Unreleased +## [3.1.15 - 2023-01-5](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.15) + +### Bug fixes + +- Fixed PHP warning when not using message thread ID + ## [3.1.14 - 2022-12-8](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.14) ### Enhancements diff --git a/composer.json b/composer.json index 00a22d1..53dd1c4 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "wptelegram/core", - "version": "3.1.14", + "version": "3.1.15", "description": "Integrate your WordPress site perfectly with Telegram with full control.", "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "*", diff --git a/package.json b/package.json index 0634257..99144e8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wptelegram", "title": "WP Telegram", - "version": "3.1.14", + "version": "3.1.15", "description": "Integrate your WordPress site perfectly with Telegram with full control.", "repository": { "type": "git", diff --git a/src/README.txt b/src/README.txt index 4d2144a..4e1bb87 100644 --- a/src/README.txt +++ b/src/README.txt @@ -5,7 +5,7 @@ Tags: telegram, notifications, posts, channel, group Requires at least: 5.8 Tested up to: 6.1.1 Requires PHP: 7.0 -Stable tag: 3.1.14 +Stable tag: 3.1.15 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -205,6 +205,9 @@ Yes, all you need to do is to setup **Private Notifications** module and use the == Changelog == += 3.1.15 = +- Fixed PHP warning when not using message thread ID + = 3.1.14 = - Added support for sending messages to topics with groups - Fixed messages not sent when replied-to message is not found diff --git a/src/changelog.md b/src/changelog.md index fa0e943..3b240cb 100644 --- a/src/changelog.md +++ b/src/changelog.md @@ -4,6 +4,12 @@ All notable changes to this project are documented in this file. ## Unreleased +## [3.1.15 - 2023-01-5](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.15) + +### Bug fixes + +- Fixed PHP warning when not using message thread ID + ## [3.1.14 - 2022-12-8](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.14) ### Enhancements diff --git a/src/includes/wptelegram-bot-api b/src/includes/wptelegram-bot-api index 7766873..4a21b94 160000 --- a/src/includes/wptelegram-bot-api +++ b/src/includes/wptelegram-bot-api @@ -1 +1 @@ -Subproject commit 77668739a66b2b01a267de1e6619b9b21ddd63a5 +Subproject commit 4a21b9462427a3d5822a15dd59e0afc3cb1f70d5 diff --git a/src/languages/wptelegram.pot b/src/languages/wptelegram.pot index 58d74c0..7efc0f6 100644 --- a/src/languages/wptelegram.pot +++ b/src/languages/wptelegram.pot @@ -1,14 +1,14 @@ -# Copyright (C) 2022 +# Copyright (C) 2023 # This file is distributed under the same license as the package. msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n" -"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n" +"POT-Creation-Date: 2023-01-05 12:53:18+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2022-12-8 11:440\n" +"PO-Revision-Date: 2023-01-5 12:530\n" "Last-Translator: WP Telegram\n" "Language-Team: WP Telegram\n" "Language: en_US\n" diff --git a/src/modules/p2tg/PostSender.php b/src/modules/p2tg/PostSender.php index 6baa600..8bbce23 100644 --- a/src/modules/p2tg/PostSender.php +++ b/src/modules/p2tg/PostSender.php @@ -1563,7 +1563,7 @@ private function send_responses() { $params = reset( $response ); $method = key( $response ); - list( $params['chat_id'], $params['message_thread_id'] ) = explode( ':', $channel ); + list( $params['chat_id'], $params['message_thread_id'] ) = array_pad( explode( ':', $channel ), 2, '' ); if ( ! $params['message_thread_id'] ) { unset( $params['message_thread_id'] ); diff --git a/src/wptelegram.php b/src/wptelegram.php index f8e0612..fcc4030 100644 --- a/src/wptelegram.php +++ b/src/wptelegram.php @@ -10,7 +10,7 @@ * Plugin Name: WP Telegram * Plugin URI: https://t.me/WPTelegram * Description: Integrate your WordPress website perfectly with Telegram. Send posts automatically to Telegram when published or updated, whether to a Telegram Channel, Group or private chat, with full control. Get your email notifications on Telegram. - * Version: 3.1.14 + * Version: 3.1.15 * Author: WP Socio * Author URI: https://wpsocio.com * License: GPL-2.0+ @@ -24,7 +24,7 @@ die; } -define( 'WPTELEGRAM_VER', '3.1.14' ); +define( 'WPTELEGRAM_VER', '3.1.15' ); defined( 'WPTELEGRAM_BASENAME' ) || define( 'WPTELEGRAM_BASENAME', plugin_basename( __FILE__ ) );