# Unwrapped 代码块阻止进一步编辑

**URL:** https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808
**Category:** Support
**Created:** [2024年五月5日 15:25 UTC](https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808 "2024-05-05T15:25:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Divinebaboon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divinebaboon/32/383698_2.png) [@Divinebaboon](https://meta.discourse.org/u/Divinebaboon)
#### Post date: [2024年五月5日 15:25 UTC](https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808/1 "2024-05-05T15:25:19Z")

</div>

用户发布了如下回复，然后发布后，任何人尝试编辑时都会遇到 403 错误。

 ![2024-05-05 11_24_23-Window](https://global.discourse-cdn.com/meta/original/4X/3/a/f/3af6090bebf6a7d6e491f93a0d29d462bbe53131.png)

导致错误的示例如下。

编辑：奇怪，我不知道为什么我可以在这个论坛上编辑它，但在另一个论坛上，我会收到 403 错误……  
我在那里有信任等级 4，并且我尝试编辑我自己的回复，所以权限不应该是问题。

---

<div class="post-metadata">

### Author: ![Divinebaboon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divinebaboon/32/383698_2.png) [@Divinebaboon](https://meta.discourse.org/u/Divinebaboon)
#### Post date: [2024年五月5日 15:25 UTC](https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808/2 "2024-05-05T15:25:51Z")

</div>

加完了所有的卡之后，打开命令行(Terminal.app)。复制粘贴下面的代码。

```
mkdir ~/Desktop/cards
files=(~/Library/Passes/Cards/*.pkpass/cardBackgroundCombined@2x.png)
i=0
for f in "${files[@]}"; do
    i=$(( i + 1 ))
    cp $f ~/Desktop/cards/$i.png
done

```

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [2024年五月5日 16:16 UTC](https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808/3 "2024-05-05T16:16:35Z")

</div>

您好，欢迎来到 Meta 👋

您能否检查一下浏览器的控制台（以及网络选项卡），以了解您收到 403 错误请求的来源？  
这可能是草稿问题 🤔。

另外，在安全模式下是否仍然发生这种情况？

---

<div class="post-metadata">

### Author: ![Divinebaboon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divinebaboon/32/383698_2.png) [@Divinebaboon](https://meta.discourse.org/u/Divinebaboon)
#### Post date: [2024年五月5日 23:23 UTC](https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808/4 "2024-05-05T23:23:58Z")

</div>

感谢您的回复，我刚尝试了安全模式，并勾选了所有复选框，但问题仍然存在。  
这是网络和控制台选项卡，触发错误时会出现这两个控制台选项卡错误。

 ![3 screenshots](https://global.discourse-cdn.com/meta/original/4X/6/8/f/68f3598df6d765a448d3d30f58b97333278ab4e0.png)

有用户建议是 cloudflare 引起的……

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [2024年五月6日 00:52 UTC](https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808/5 "2024-05-06T00:52:59Z")

</div>

> [@Divinebaboon](#):
>
> 一位用户建议是 Cloudflare 引起的……

你说得对。这里有一个类似的主题：

> [@Error with code blocks: 403 Forbidden](https://meta.discourse.org/t/error-with-code-blocks-403-forbidden/280764/3?u=arkshine):
>
> Further to this, we nearly always find that 403 errors like this when attempting to create posts (especially with code blocks!) are due to an overzealous [WAF](https://en.wikipedia.org/wiki/Web_application_firewall) believing the code blocks are shellcode or an injection attack. I note that the instance in question seems to be fronted by a WAF: ○ → host hpc-discourse.uni.lu hpc-discourse.uni.lu is an alias for fstc-waf2.uni.lu. and thus I strongly suspect the 403 errors are coming not from Discourse, but from your WAF. Inspecting the headers of th…

---

<div class="post-metadata">

### Author: ![Divinebaboon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divinebaboon/32/383698_2.png) [@Divinebaboon](https://meta.discourse.org/u/Divinebaboon)
#### Post date: [2024年五月6日 02:38 UTC](https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808/6 "2024-05-06T02:38:28Z")

</div>

感谢您的帮助，确实是 Cloudflare WAF。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2024年六月5日 02:38 UTC](https://meta.discourse.org/t/unwrapped-code-block-prevents-further-edits/306808/7 "2024-06-05T02:38:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
