Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #52892, comment 5


Ignore:
Timestamp:
04/12/2021 07:51:19 PM (5 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #52892, comment 5

    v1 v2  
    1 Thanks for the PR!
     1Thanks for the PR! This mostly looks good to me, I only have a couple notes:
    22
    33* It's not quite clear to me why we only append `json_last_error_msg()` if there is no error code. In my testing, that leads to not getting any additional information about the error, while the actual error in my case was "Malformed UTF-8 characters, possibly incorrectly encoded". If `json_last_error()` is `JSON_ERROR_NONE` or empty, I don't think `json_encode()` would have returned `false` in the first place, unless I'm missing something. So I think it would make sense to always include `json_last_error_msg()` here. Something like: