将MySQL UUID Unicode字符从JSON响应到PHP中的Hex

发布于 2025-02-13 09:16:52 字数 1201 浏览 0 评论 0原文

我在浏览器中使用MySQL错误获得了API响应。

Create_at)值 (\ u0027 \ ufffdl \ ufffd = \ ufffd \ ufffda \ uffda \ u01e0 \\\ f \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ uffd \ ufffd \ ufffd \ ufffd \ uffd \ \ u0027,\ u0027,\ u0027 \ u0027 \ u u 0010 \ ufffd \ u0019 \ ufffd \ u0370a \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffdv \ u001d \ ufffd \ ufffd \ uffd \ u0027,\ u00272022-2-07-04 14:57:24.766 \ u0027); \ u0027:\ n \ nsqlstate [23000]:完整性约束 违规:1452无法添加或更新子行:外键 约束失败(shopwarecategory_certificate,约束 fk_9c7a6a4799223ffd外键(cetidect_id)参考 category_certificateid)删除级联)

我想找出此SQL查询中使用的UUID的十六进制。 Tried few things like json_decode, or mb_convert_encoding the \u0027\ufffdl\ufffd=\ufffd\ufffdA\u01e0\\\f\ufffd\ufffd\ufffd\ufffd\ufffd\u0027 string like mentioned here https://stackoverflow.com/a/a/6058533/7275814 ,但我总是只得到人类的unicode chars buthable Hex hex' UUID。如何将其转换为通过调试进行处理?

I get an API response with a mysql error in the browser.

INSERT INTO category_certificate (category_id, certificate_id,
created_at) VALUES
(\u0027\ufffdl\ufffd=\ufffd\ufffdA\u01e0\\\f\ufffd\ufffd\ufffd\ufffd\ufffd\u0027,\u0027\u0010\ufffd\u0019\ufffd\u0370A\ufffd\ufffd\ufffd\ufffdV\u001d\ufffd\u0027,\u00272022-07-04
14:57:24.766\u0027);\u0027:\n\nSQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key
constraint fails (shopware.category_certificate, CONSTRAINT
FK_9C7A6A4799223FFD FOREIGN KEY (certificate_id) REFERENCES
category_certificate (id) ON DELETE CASCADE)

I want to find out the hex of the UUIDs used in this SQL query. Tried few things like json_decode, or mb_convert_encoding the \u0027\ufffdl\ufffd=\ufffd\ufffdA\u01e0\\\f\ufffd\ufffd\ufffd\ufffd\ufffd\u0027 string like mentioned here https://stackoverflow.com/a/6058533/7275814 but I always just get the unicode chars not the human readable hex'd UUID. How can I convert this, to process with debugging?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖乖哒 2025-02-20 09:16:52

正如@michas在评论中已经提到的那样,不可能从该字符串中重新获得原始二进制数据。如果您处于dev环境中,则应该能够查看对API请求的响应,并在标题X-下找到该请求的Symfony Profiler页面的URL debug-token-link。在“ Profiler”页面上,如果您查看可运行的版本,则可以在“学说”选项卡下找到具有可读参数的查询。但是,它们可能无法阅读,因为当时UUID可能已经转换为二进制数据。然后,最好的选择将是“异常”选项卡,您可以在堆栈中找到一个曝光原始有效载荷的呼叫,例如呼叫apicontroller :: executeWritePoperation

As @Michas already mentioned in a comment it is not possible to regain the original binary data from that string. If you're in a dev environment, then you should be able to look at the response to your API request and find a URL to the Symfony Profiler page for that request under the header X-Debug-Token-Link. On the Profiler page you might be able to find the Query under the Doctrine tab with readable parameters if you look at the runnable version. However they might not be readable there, as the UUIDs will probably have been converted to binary data already at that point. Then your best bet would be the Exception tab where you might be able to find a call in the stack that exposes the original payload, e.g. a call to ApiController::executeWriteOperation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文