Forgot password?
 Create new account
View 152|Reply 6

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

[Copy link]

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

hbghlyj Posted at 2024-2-8 20:33:49 |Read mode
Last edited by hbghlyj at 2025-3-2 16:12:00
  1. \"A
Copy the Code

帖子中本來是\"A,變成了"A
录屏:
output.gif

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

 Author| hbghlyj Posted at 2024-2-8 21:44:51
@kuing 您是否遇到過這種情況?

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

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

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2024-2-8 23:42:52

确实是这样,你看一下源代码找下原因吧

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

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

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2024-2-9 15:41:45
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 at 2024-2-9 15:43

手机版Mobile version|Leisure Math Forum

2025-4-20 22:09 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list