From 859344b8fdfbe34ad496d75ed93f6399d82ece56 Mon Sep 17 00:00:00 2001 From: vasikgreif Date: Fri, 5 Feb 2021 15:23:57 +0100 Subject: [PATCH 1/2] Fix disconnect button --- composer.lock | 50 ++++++++++++++++++++++++++++++++---------------- src/Settings.php | 4 +--- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/composer.lock b/composer.lock index 7199357..1ae808e 100644 --- a/composer.lock +++ b/composer.lock @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/CMB2/CMB2.git", - "reference": "008d9b83263d971d6bd41c27e31113db852d5ef3" + "reference": "da5a64053a915cf945c34f2e3fa71bbcc6d2be10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CMB2/CMB2/zipball/008d9b83263d971d6bd41c27e31113db852d5ef3", - "reference": "008d9b83263d971d6bd41c27e31113db852d5ef3", + "url": "https://api.github.com/repos/CMB2/CMB2/zipball/da5a64053a915cf945c34f2e3fa71bbcc6d2be10", + "reference": "da5a64053a915cf945c34f2e3fa71bbcc6d2be10", "shasum": "" }, "require": { @@ -37,17 +37,17 @@ "GPL-2.0-or-later" ], "authors": [ - { - "name": "WebDevStudios", - "email": "contact@webdevstudios.com", - "homepage": "https://github.com/WebDevStudios", - "role": "Developer" - }, { "name": "Justin Sternberg", "email": "justin@dsgnwrks.pro", "homepage": "https://dsgnwrks.pro", "role": "Developer" + }, + { + "name": "WebDevStudios", + "email": "contact@webdevstudios.com", + "homepage": "https://github.com/WebDevStudios", + "role": "Developer" } ], "description": "CMB2 is a metabox, custom fields, and forms library for WordPress that will blow your mind.", @@ -57,7 +57,11 @@ "plugin", "wordpress" ], - "time": "2019-01-21T04:30:08+00:00" + "support": { + "issues": "https://github.com/CMB2/CMB2/issues", + "source": "http://wordpress.org/support/plugin/cmb2" + }, + "time": "2020-08-03T14:43:02+00:00" }, { "name": "tgmpa/tgm-plugin-activation", @@ -112,6 +116,10 @@ "theme", "wordpress" ], + "support": { + "issues": "https://github.com/TGMPA/TGM-Plugin-Activation/issues", + "source": "https://github.com/TGMPA/TGM-Plugin-Activation" + }, "time": "2016-05-19T15:46:51+00:00" }, { @@ -159,6 +167,11 @@ "faktura", "vyfakturuj" ], + "support": { + "email": "info@vyfakturuj.cz", + "issues": "https://github.com/redbitcz/vyfakturuj-api-php/issues", + "source": "https://github.com/redbitcz/vyfakturuj-api-php/tree/v2.5.0" + }, "time": "2020-05-13T11:28:43+00:00" }, { @@ -181,23 +194,24 @@ "suggest": { "composer/installers": "~1.0" }, + "default-branch": true, "type": "wordpress-plugin", "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "authors": [ - { - "name": "WebDevStudios", - "email": "contact@webdevstudios.com", - "homepage": "https://github.com/WebDevStudios", - "role": "Developer" - }, { "name": "Justin Sternberg", "email": "justin@dsgnwrks.pro", "homepage": "https://dsgnwrks.pro", "role": "Developer" + }, + { + "name": "WebDevStudios", + "email": "contact@webdevstudios.com", + "homepage": "https://github.com/WebDevStudios", + "role": "Developer" } ], "description": "Custom field for CMB2 which adds a post-search dialog for searching/attaching other post IDs.", @@ -209,6 +223,10 @@ "search", "wordpress" ], + "support": { + "issues": "https://github.com/CMB2/CMB2-Post-Search-field/issues", + "source": "https://github.com/CMB2/CMB2-Post-Search-field" + }, "time": "2019-05-06T18:50:39+00:00" } ], diff --git a/src/Settings.php b/src/Settings.php index 0b05c67..ac33d1b 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -82,9 +82,7 @@ public function field_type_disconnect_button( $object_type, $field_type_object ) { - echo '' - . _e( 'Disconnect Simple Shop', 'simpleshop-cz' ) - . ''; + printf( '%s', admin_url( 'admin.php?page=ssc_options&disconnect_simpleshop=1' ), __( 'Disconnect Simple Shop', 'simpleshop-cz' ) ); } /** From 3545b68e44d8c4311c4e22be97d7cae3e0b262e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Fri, 5 Feb 2021 15:36:24 +0100 Subject: [PATCH 2/2] Fix disconnect button - escape HTML attribute --- src/Settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Settings.php b/src/Settings.php index ac33d1b..ee05ae7 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -82,7 +82,11 @@ public function field_type_disconnect_button( $object_type, $field_type_object ) { - printf( '%s', admin_url( 'admin.php?page=ssc_options&disconnect_simpleshop=1' ), __( 'Disconnect Simple Shop', 'simpleshop-cz' ) ); + printf( + '%s', + htmlspecialchars( admin_url( 'admin.php?page=ssc_options&disconnect_simpleshop=1' ) , ENT_QUOTES), + __( 'Disconnect Simple Shop', 'simpleshop-cz' ) + ); } /** @@ -389,6 +393,7 @@ public function settings_notices( $object_id, $updated ) { add_settings_error( $this->key . '-error', '', __( 'Error during communication with SimpleShop API, please try it later', 'simpleshop-cz' ), 'error' ); settings_errors( $this->key . '-error' ); + return; }