Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] Some string recasts needed for exports #8342

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

sbulen
Copy link
Contributor

@sbulen sbulen commented Nov 11, 2024

While testing #8244 , I found two minor unrelated issues with the export. This PR addresses both.

When requesting html exports, the task would hang, leaving this in the PHP error log, and an entry in background_tasks:

PHP Fatal error:  Uncaught TypeError: hash_hmac(): Argument #2 ($data) must be of type string, int given in D:\wamp64\www\84van30\Sources\Tasks\ExportProfileData.php:1270
Stack trace:
#0 D:\wamp64\www\84van30\Sources\Tasks\ExportProfileData.php(1270): hash_hmac('sha1', 1, Object(SensitiveParameterValue))
#1 D:\wamp64\www\84van30\Sources\Tasks\ExportProfileData.php(930): SMF\Tasks\ExportProfileData->exportHtml()
#2 D:\wamp64\www\84van30\Sources\TaskRunner.php(565): SMF\Tasks\ExportProfileData->execute()
#3 D:\wamp64\www\84van30\Sources\TaskRunner.php(201): SMF\TaskRunner->performTask(Array)
#4 D:\wamp64\www\84van30\cron.php(32): SMF\TaskRunner->execute()
#5 {main}
  thrown in D:\wamp64\www\84van30\Sources\Tasks\ExportProfileData.php on line 1270

When requesting xml exports, the task would appear to complete, and generate an export file for download, but when you opened the export it contained this:

Fatal error:  Uncaught TypeError: hash_hmac(): Argument #2 ($data) must be of type string, int given in D:\wamp64\www\84van30\Sources\Actions\Profile\ExportDownload.php:176
Stack trace:
#0 D:\wamp64\www\84van30\Sources\Actions\Profile\ExportDownload.php(176): hash_hmac('sha1', 6, Object(SensitiveParameterValue))
#1 D:\wamp64\www\84van30\Sources\ActionTrait.php(44): SMF\Actions\Profile\ExportDownload->__construct()
#2 D:\wamp64\www\84van30\Sources\ActionTrait.php(55): SMF\Actions\Profile\ExportDownload::load()
#3 [internal function]: SMF\Actions\Profile\ExportDownload::call(6)
#4 D:\wamp64\www\84van30\Sources\Actions\Profile\Main.php(683): call_user_func(Array, 6)
#5 D:\wamp64\www\84van30\Sources\ActionTrait.php(55): SMF\Actions\Profile\Main->execute()
#6 [internal function]: SMF\Actions\Profile\Main::call()
#7 D:\wamp64\www\84van30\Sources\Forum.php(264): call_user_func(Array)
#8 D:\wamp64\www\84van30\index.php(149): SMF\Forum->execute()
#9 {main}
  thrown in D:\wamp64\www\84van30\Sources\Actions\Profile\ExportDownload.php on line 176

Tested in 3.0 with current GH code, both test OK.

@Sesquipedalian Sesquipedalian merged commit e43eeb8 into SimpleMachines:release-3.0 Nov 11, 2024
6 checks passed
@sbulen
Copy link
Contributor Author

sbulen commented Nov 11, 2024

Note that SMF errors were not logged in the error log in either case above. One error was in the PHP log and one was in the actual resultant .html file itself.

I've seen a fair amount of this recently, lots of errors in the PHP log but not the SMF log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants