Skip to content

Bug: Incorrect Display of Escaped JSON Strings in Redis Value Viewer (Breaks HTML Rendering in JSON Objects) #55

@bzcomputers

Description

@bzcomputers

What version of phpCacheAdmin are you using?

2.3.1

Cache system and version

No response

Extension or client and version

No response

PHP Version

8.4.14

Operating System

AlmaLinux 8

Describe the issue

phpCacheAdmin’s value viewer misrepresents valid JSON strings containing escaped HTML.
It shows <\/a> and \" as literal characters instead of rendering the decoded, clean HTML that json_decode() produces in PHP.

This creates false appearance of data corruption, even though:

  1. The Redis data is valid JSON
  2. json_decode() in PHP works perfectly
  3. The application renders correct HTML

The issue is purely visual in the UI and does not affect data integrity.

Steps to Reproduce:

  1. Store a JSON string in Redis containing HTML with closing tags (e.g., </a>) and double quotes.
  2. View the key in phpCacheAdmin.
  3. Observe broken display: <\/a> and \" remain escaped.

Expected Behavior:
The viewer should either:
Show raw escaped JSON (like redis-cli)
Or decode and display clean HTML (like after json_decode())

Actual Behavior:
Partial unescaping breaks the preview:
<\/a> remains as <\/a> (not converted to </a>)
\" remains as \" (not converted to ")

Result: HTML appears broken and unreadable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions