如果您订阅了我的新闻通讯已有一段时间,则可能已经注意到我有几周没有发送电子邮件了。 事实证明,我管理过我的RSS feed,您也可以这样做一个简单的把戏。
Backstory
In case you’re not a regular subscriber, here’s the situation. Every Friday at noon, I send an automated email to all of my subscribers using MailChimp. For simplicity, that email is generated using my RSS feed. Specifically, each week an email is created from the two posts from the previous week.
好吧,在某个时候,我的常规每周电子邮件都变得黑了:
如您所见,我于8月9日发送了一封电子邮件,然后直到8月24日我更正了该问题之后,我才再次发送一封电子邮件。 换句话说,有两个星期的电子邮件遗漏。
有一次,当我收到一封电子邮件,说我有一个新订户时,我正在外面。 突然,我意识到自己有一段时间没有收到自己的一封电子邮件,因此我决定进行调查。 是的,我的自动电子邮件已经失效了一段时间。
Investigation
当我回到家时,我决定跳上我的MailChimp帐户,看看是否可以找到任何问题。 由于我没有任何通知,因此我认为执行IT部门通常的做法可能是个好主意:关闭并打开自动电子邮件。 不幸的是,我无法重新打开电子邮件。
According to MailChimp, I didn’t have a proper RSS feed. In the past, one of my plugins messed up my feed, so I was thinking maybe that was the issue. Of course, I didn’t trust MailChimp, so I grabbed my RSS feed and dropped it into an RSS validator.
When I did that, I found that MailChimp was actually telling the truth. Apparently, there was some part of my feed which wasn’t properly formed. Fortunately, the validator was able to give me the exact line. When I investigated further, I realized it was an issue with a singular character in one of my articles.
如果您点击该链接,您将被带到一篇无害的文章。 通常,本文的前提是共享有关Java中不同原始类型的一些详细信息。 当然,对于每种原始类型,我决定共享它们的范围。 那是我遇到问题的时候。
One Tip to Nuke Your RSS Feed
如果您熟悉Java,则可能知道字符不是8位。 相反,它们是16位的,这意味着它们的范围从0扩展到65,535。 当然,并非所有这些字符都有效。
例如,在有关原始类型的文章中,我决定使用以下命令演示字符范围:
Character.MIN_VALUE // Prints the character at index 0
Character.MAX_VALUE // Prints the character at index 65,535
当然,当我写这篇文章时,我实际上展示了这个角色:
当我将该方框字符粘贴到文章中时,WordPress从未真正抱怨过。 实际上,它的呈现方式与文章中的描述完全相同,而且我并没有真正注意到任何问题。
不幸的是,距离我对RSS feed的影响还差了两个星期。 解决此问题后,那天晚上我转身并发送了一封电子邮件。
Moral of the Story
事实证明,某些字符在RSS中被视为无效。 不幸的是,除了论坛上的一些低质量帖子外,我找不到关于此问题的任何文档。
如果我不得不猜测的话,XML规范中有一个非法字符列表。 结果,RSS规范继承了那些非法字符,甚至可能添加到其中。 如果有人对这种问题有更多的了解,请告诉我。
At any rate, after this happened, I told one of my friends—Robert—about it, and he thought it was hilarious. Ever since, he’s been dumping that box character into all sorts of interfaces including Discord and iMessage. So far, we haven’t seen any issues. However, it does render differently depending on the platform.
After chatting, we remembered there used to be a funny character related bug in chrome which would crash the browser. In fact, a lot of people were making funny games where you would have to avoid touching buttons that would load the character. If you’re interested in that sort of thing, I found an article from 2015 that details the whole saga.
Help Grow The Renegade Coder
好吧,一天的乐趣就足够了。 如果您喜欢这种内容,我不介意分享有关所遇到的错误的信息。 地狱,这实际上可能是一个有趣的新系列。
Regardless, thanks again for your support. If you’d like to show a little extra, head on over to Patreon where you can toss me a couple bucks for my efforts. Also, you’re welcome to join the mailing list where you’ll receive one email a week.
当您在这里时,我有更多的内容来自:
- How to Spot a Bad Mentor (Premium)
- How I Almost Built a Twitter Bot
- How to Clean Your WordPress Database
与往常一样,感谢您的光临!
The post How to Nuke Your RSS Feed appeared first on Ťhe Renegade Coder.