From 1555d70ad277914a89a376154368757b920eccb3 Mon Sep 17 00:00:00 2001 From: Kevin Pliester <5339107+pixelbart@users.noreply.github.com> Date: Wed, 8 Dec 2021 12:51:44 +0100 Subject: [PATCH] Update Plugin.class.php **Fixed** * Notice: Undefined index: port in wp-content/plugins/wp-less/lib/Plugin.class.php on line 312 * Notice: Undefined index: path in wp-content/plugins/wp-less/lib/Plugin.class.php on line 312 * Notice: Undefined index: extension in wp-content/plugins/wp-less/lib/Plugin.class.php on line 316 * Notice: Undefined index: filename in wp-content/plugins/wp-less/lib/Plugin.class.php on line 317 --- lib/Plugin.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Plugin.class.php b/lib/Plugin.class.php index b248a9c..781528a 100644 --- a/lib/Plugin.class.php +++ b/lib/Plugin.class.php @@ -309,12 +309,16 @@ public function processEditorStylesheets($mce_css) { // Remove version from uri $parts = parse_url( $style_sheet ); + + $parts['port'] = (isset($parts['port'])) ? $parts['port'] : false; + $parts['path'] = (isset($parts['path'])) ? $parts['path'] : ''; + $style_sheet = $parts['scheme'] . '://' . $parts['host'] . (!$parts['port'] ? '' : (':' . $parts['port'])) . $parts['path']; // Get extension and set handle for wp_register_style() $pathinfo = pathinfo($style_sheet); - $extension = $pathinfo['extension']; - $handle = $pathinfo['filename']; + $extension = (isset($pathinfo['extension'])) ? $pathinfo['extension'] : ''; + $handle = (isset($pathinfo['filename'])) ? $pathinfo['filename'] : ''; // Only process less files if( $extension === 'less' ) {