diff --git a/CMakeLists.txt b/CMakeLists.txt index d964ad64..b5ea0522 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_CMAKE_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${MY_CMAKE_FLAGS}") +add_definitions(-DDISABLE_OBJ_POOL) #set(MY_CMAKE_POOL_FLAG " -DPOOL_TESTING -DUSE_VALGRIND") #add_definitions(-DPOOL_TESTING) #add_definitions(-DLS_WORKCREW_DEBUG) diff --git a/LSQUICCOMMIT b/LSQUICCOMMIT index e93306e8..9ef0f299 100644 --- a/LSQUICCOMMIT +++ b/LSQUICCOMMIT @@ -1 +1 @@ -497ec21d1605aeaaa21fb2e67066d7d47e3d916d +e237d779199dab262c54d104238006efa9abd766 diff --git a/dist/add-ons/webcachemgr/VERSION b/dist/add-ons/webcachemgr/VERSION index 66060a1f..a86adafd 100644 --- a/dist/add-ons/webcachemgr/VERSION +++ b/dist/add-ons/webcachemgr/VERSION @@ -1 +1 @@ -1.13.11.1 \ No newline at end of file +1.13.13.1 \ No newline at end of file diff --git a/dist/add-ons/webcachemgr/src/Panel/ControlPanel.php b/dist/add-ons/webcachemgr/src/Panel/ControlPanel.php index d8982b55..43a38b89 100644 --- a/dist/add-ons/webcachemgr/src/Panel/ControlPanel.php +++ b/dist/add-ons/webcachemgr/src/Panel/ControlPanel.php @@ -4,7 +4,7 @@ * LiteSpeed Web Server Cache Manager * * @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com) - * @copyright (c) 2017-2021 + * @copyright (c) 2017-2022 * ******************************************* */ namespace Lsc\Wp\Panel; @@ -36,7 +36,7 @@ abstract class ControlPanel /** * @var string */ - const PANEL_API_VERSION = '1.13.11.1'; + const PANEL_API_VERSION = '1.13.13.1'; /** * @since 1.9 @@ -986,6 +986,9 @@ public static function meetsMinAPIVerRequirement() public static function checkPanelAPICompatibility( $panelAPIVer ) { $supportedAPIVers = array( + '1.13.13.1', + '1.13.13', + '1.13.12', '1.13.11.1', '1.13.11', '1.13.10.2', diff --git a/dist/add-ons/webcachemgr/src/Panel/CustomPanel.php b/dist/add-ons/webcachemgr/src/Panel/CustomPanel.php index c92fc463..1380cbd1 100644 --- a/dist/add-ons/webcachemgr/src/Panel/CustomPanel.php +++ b/dist/add-ons/webcachemgr/src/Panel/CustomPanel.php @@ -9,7 +9,7 @@ namespace Lsc\Wp\Panel; -use \Lsc\Wp\WPInstall; +use Lsc\Wp\WPInstall; class CustomPanel extends CustomPanelBase diff --git a/dist/add-ons/webcachemgr/src/PluginVersion.php b/dist/add-ons/webcachemgr/src/PluginVersion.php index 74ddc270..e7c40d54 100644 --- a/dist/add-ons/webcachemgr/src/PluginVersion.php +++ b/dist/add-ons/webcachemgr/src/PluginVersion.php @@ -4,7 +4,7 @@ * LiteSpeed Web Server Cache Manager * * @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com) - * @copyright (c) 2018-2020 + * @copyright (c) 2018-2022 * ******************************************* */ @@ -416,17 +416,19 @@ protected function refreshVersionList( $isforced = false ) if ( $isforced || !file_exists($this->versionFile) || (time() - filemtime($this->versionFile)) > 86400 ) { - $content = Util::get_url_contents($versionsUrl); - - if ( !empty($content) ) { + if ( !file_exists(Context::LOCAL_PLUGIN_DIR) ) { + $this->createDownloadDir(); + } - if ( !file_exists(Context::LOCAL_PLUGIN_DIR) ) { - $this->createDownloadDir(); - } + $content = Util::get_url_contents($versionsUrl); + if ( !empty($content) && substr($content, 0, 7) == 'allowed' ) { file_put_contents($this->versionFile, $content); Logger::info('LSCache for WordPress version list updated'); } + else { + touch($this->versionFile); + } } } diff --git a/dist/add-ons/webcachemgr/src/Util.php b/dist/add-ons/webcachemgr/src/Util.php index 1465a89a..db07060e 100644 --- a/dist/add-ons/webcachemgr/src/Util.php +++ b/dist/add-ons/webcachemgr/src/Util.php @@ -466,4 +466,70 @@ public static function rrmdir( $dir, $keepParent = false ) return false; } + /** + * Wrapper for idn_to_utf8() function call to avoid "undefined" exceptions + * when PHP intl module is not installed and enabled. + * + * @since 1.13.13.1 + * + * @param string $domain + * @param int $flags + * @param int|null $variant + * @param array|null $idna_info + * + * @return false|string + */ + public static function tryIdnToUtf8( + $domain, + $flags = 0, + $variant = null, + array &$idna_info = null ) + { + if ( function_exists('idn_to_utf8') ) { + + if ( $variant == null ) { + $variant = INTL_IDNA_VARIANT_UTS46; + } + + return idn_to_utf8($domain, $flags, $variant, $idna_info); + } + + return $domain; + } + + /** + * Wrapper for idn_to_ascii() function call to avoid "undefined" exceptions + * when PHP intl module is not installed and enabled. + * + * @since 1.13.13.1 + * + * @param string $domain + * @param int|null $flags + * @param int|null $variant + * @param array|null $idna_info + * + * @return false|string + */ + public static function tryIdnToAscii( + $domain, + $flags = null, + $variant = null, + array &$idna_info = null ) + { + if ( function_exists('idn_to_ascii') ) { + + if ($flags = null ) { + $flags = IDNA_DEFAULT; + } + + if ( $variant == null ) { + $variant = INTL_IDNA_VARIANT_UTS46; + } + + return idn_to_ascii($domain, $flags, $variant, $idna_info); + } + + return $domain; + } + } diff --git a/dist/add-ons/webcachemgr/src/View/Model/Ajax/CacheMgrRowViewModel.php b/dist/add-ons/webcachemgr/src/View/Model/Ajax/CacheMgrRowViewModel.php index 63da7bd0..86c12cd8 100644 --- a/dist/add-ons/webcachemgr/src/View/Model/Ajax/CacheMgrRowViewModel.php +++ b/dist/add-ons/webcachemgr/src/View/Model/Ajax/CacheMgrRowViewModel.php @@ -11,6 +11,7 @@ use \Lsc\Wp\Context\Context; use \Lsc\Wp\LSCMException; use \Lsc\Wp\PluginVersion; +use Lsc\Wp\Util; use \Lsc\Wp\WPInstall; class CacheMgrRowViewModel @@ -79,7 +80,9 @@ protected function setListRowData() 'statusData' => $this->getStatusDisplayData(), 'flagData' => $this->getFlagDisplayData(), - 'siteUrl' => $this->wpInstall->getData(WPInstall::FLD_SITEURL) + 'siteUrl' => Util::tryIdnToUtf8( + $this->wpInstall->getData(WPInstall::FLD_SITEURL) + ) ); $listData[$this->wpInstall->getPath()] = $info; diff --git a/dist/add-ons/webcachemgr/src/View/Model/ManageViewModel.php b/dist/add-ons/webcachemgr/src/View/Model/ManageViewModel.php index da2911c0..de4c649b 100644 --- a/dist/add-ons/webcachemgr/src/View/Model/ManageViewModel.php +++ b/dist/add-ons/webcachemgr/src/View/Model/ManageViewModel.php @@ -10,6 +10,7 @@ namespace Lsc\Wp\View\Model; use \Lsc\Wp\Context\Context; +use Lsc\Wp\Util; use \Lsc\Wp\WPInstallStorage; use \Lsc\Wp\WPInstall; use \Lsc\Wp\PluginVersion; @@ -255,7 +256,9 @@ protected function setListAndCountData() $this->getStatusDisplayData($wpInstall, $countData), 'flagData' => $this->getFlagDisplayData($wpInstall, $countData), - 'siteUrl' => $wpInstall->getData(WPInstall::FLD_SITEURL) + 'siteUrl' => Util::tryIdnToUtf8( + $wpInstall->getData(WPInstall::FLD_SITEURL) + ) ); $listData[$wpInstall->getPath()] = $info; diff --git a/dist/add-ons/webcachemgr/src/WPInstall.php b/dist/add-ons/webcachemgr/src/WPInstall.php index f2309381..25add354 100644 --- a/dist/add-ons/webcachemgr/src/WPInstall.php +++ b/dist/add-ons/webcachemgr/src/WPInstall.php @@ -192,7 +192,7 @@ public function __toString() $this->path, $this->data[self::FLD_STATUS], $this->data[self::FLD_DOCROOT], - $this->data[self::FLD_SITEURL] + Util::tryIdnToUtf8($this->data[self::FLD_SITEURL]) ); } @@ -231,7 +231,10 @@ public function getServerName() */ public function setServerName( $serverName ) { - return $this->setData(self::FLD_SERVERNAME, $serverName); + return $this->setData( + self::FLD_SERVERNAME, + Util::tryIdnToAscii($serverName) + ); } /** @@ -243,7 +246,10 @@ public function setServerName( $serverName ) */ public function setSiteUrlDirect( $siteUrl ) { - return $this->setData(self::FLD_SITEURL, $siteUrl); + return $this->setData( + self::FLD_SITEURL, + Util::tryIdnToAscii($siteUrl) + ); } /** @@ -464,10 +470,11 @@ public function populateDataFromUrl( $url ) $info = parse_url($parseSafeUrl); - $serverName = strtolower($info['host']); + $serverName = Util::tryIdnToAscii($info['host']); + $this->setData(self::FLD_SERVERNAME, $serverName); - $siteUrlTrim = $info['host']; + $siteUrlTrim = $serverName; if ( isset($info['path']) ) { $siteUrlTrim .= $info['path']; @@ -482,8 +489,8 @@ public function populateDataFromUrl( $url ) $this->setStatus(self::ST_ERR_DOCROOT); $this->addUserFlagFile(false); - $msg = "{$this->path} - Could not find matching document root for " - . "WP siteurl/servername {$serverName}."; + $msg = "$this->path - Could not find matching document root for " + . "WP siteurl/servername $serverName."; $this->setCmdStatusAndMsg(UserCommand::EXIT_ERROR, $msg); Logger::error($msg); diff --git a/dist/docs/AdminGeneral_Help.html b/dist/docs/AdminGeneral_Help.html index d2076dec..055657ae 100644 --- a/dist/docs/AdminGeneral_Help.html +++ b/dist/docs/AdminGeneral_Help.html @@ -17,7 +17,7 @@

OpenLiteSpeed Web Server Users' Manual

-

Version 1.7  — Rev. 27

+

Version 1.7  — Rev. 28