Forgot password
 Register account
View 257|Reply 6

[已解决] Discuz代碼块Bug:\"A 變成 "A

[Copy link]

3211

Threads

7832

Posts

52

Reputation

Show all posts

hbghlyj posted 2024-2-8 20:33 |Read mode
Last edited by hbghlyj 2025-3-2 16:12
  1. \"A
Copy the Code
帖子中本來是\"A,變成了"A
录屏:
output.gif

3211

Threads

7832

Posts

52

Reputation

Show all posts

original poster hbghlyj posted 2024-2-8 21:44
@kuing 您是否遇到過這種情況?

673

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2024-2-8 23:42
  1. test \" test
Copy the Code

673

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2024-2-8 23:42
确实是这样,你看一下源代码找下原因吧

3211

Threads

7832

Posts

52

Reputation

Show all posts

original poster hbghlyj posted 2024-2-8 23:53
kuing 发表于 2024-2-8 15:42
确实是这样,你看一下源代码找下原因吧
哇,原來有人問過了:gitee.com/Discuz/DiscuzX/issues/I45L3H
        $code = dhtmlspecialchars(str_replace('\\"', '"', $code));
      该处字符串替换含义不明,该处替换导致\" 字符串被替换为 "

673

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2024-2-9 15:41
hbghlyj 发表于 2024-2-8 23:53
哇,原來有人問過了:https://gitee.com/Discuz/DiscuzX/issues/I45L3H
        $code = dhtmlspecialchars(str ...
打开 source/function/function_discuzcode.php 第 56 行
发现其实不止这一行,前面有好几处都曾出现 str_replace('\\"', '"' ...

我现在按网页中的方法将 56 行那里改了。
前面的不敢动。

Comment

现在 1# 和 3# 已正常显示。  posted 2024-2-9 15:43

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-20 05:47 GMT+8

Powered by Discuz!

Processed in 0.014479 seconds, 27 queries