Uncaught ArgumentCountError in com/core/notice/SGNoticeHandler.php
-
A maintenance script that includes wp-config.php causes this error.
<br /> <b>Fatal error</b>: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 4 passed and exactly 5 expected. Stack trace: #0 [internal function]: {closure}() #1 [root]/wp/wp-content/plugins/backup/com/core/notice/SGNoticeHandler.php(96): strtolower() #2 [root]/wp/wp-content/plugins/backup/com/core/notice/SGNoticeHandler.php(13): SGNoticeHandler->checkExpiredLicense() #3 [root]/wp/wp-content/plugins/backup/com/core/SGBoot.php(46): SGNoticeHandler->run() #4 [root]/wp/wp-content/plugins/backup/com/boot.php(6): SGBoot::init() #5 [root]/wp/wp-content/plugins/backup/public/boot.php(2): require_once('...') #6 [root]/wp/wp-content/plugins/backup/backup.php(35): require_once('...') #7 [root]/wp/wp-settings.php(447): include_once('...') #8 [root]/wp/wp-config.php(38): require_once('...')
Since SGConfig::get() may return null, a cast to string would solve this issue.
private function checkExpiredLicense() { if (strtolower((string)SGConfig::get('SG_LICENSE_KEY_STATUS')) == JBWP_LICENSE_KEY_STATUS_EXPIRED) { SGNotice::getInstance()->addNoticeFromTemplate('expired_license_error', SG_NOTICE_ERROR, true); } }
Maybe you could consider adding this change. Thank you.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Uncaught ArgumentCountError in com/core/notice/SGNoticeHandler.php’ is closed to new replies.