Forgot password?
 Register account
View 287|Reply 6

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

[Copy link]

3153

Threads

7906

Posts

610K

Credits

Credits
64096
QQ

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

3153

Threads

7906

Posts

610K

Credits

Credits
64096
QQ

Show all posts

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

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

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

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

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

3153

Threads

7906

Posts

610K

Credits

Credits
64096
QQ

Show all posts

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

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

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

Mobile version|Discuz Math Forum

2025-6-5 01:16 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit