Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

别名生成策略——根据标题,存在可访问性问题 #6715

Open
AccAutomaton opened this issue Sep 28, 2024 · 1 comment
Open
Labels
triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@AccAutomaton
Copy link

系统信息

Dev模式

  • 外部访问地址:
  • 启动时间: 2024-09-28 10:43
  • 版本: 2.20.0-SNAPSHOT
  • 构建时间: 2024-09-28 10:43
  • Git Commit: a860cb5
  • Java: OpenJDK Runtime Environment / 21+35-2513
  • 数据库: H2 / 2.3.232
  • 操作系统: Windows 11 / 10.0
  • 已激活主题: Earth 1.9.0
  • 已启动插件:

使用的哪种方式运行?

Source Code

发生了什么?

当别名生成策略为“根据标题”时:
image

文章链接会以中文拼音的形式出现,但是如果出现同音字甚至相同标题,(可能)会导致未定义行为。

建议发布文章时检查别名的唯一性,如同上传附件的策略一样,检测到重名则添加几位随机符号。

复现步骤

  1. 创建文章《你好》
    image

  2. 创建文章《拟好》
    image

  3. 访问/ni-hao出现文章《拟好》
    image

  4. 创建文章《你好》,内容为“111”
    image

  5. 访问/ni-hao仍然出现文章《拟好》
    image

  6. 点击上一篇/下一篇依然是同一篇文章
    image

综上所述,猜测访问具有同名文章的链接是未定义的。

相关日志输出

No response

附加信息

No response

@ruibaby
Copy link
Member

ruibaby commented Sep 28, 2024

别名重复的相关问题:#3332

短期内,你可以先设置为其他路由规则,或者手动修改别名,参考:https://docs.halo.run/user-guide/settings#%E4%B8%BB%E9%A2%98%E8%B7%AF%E7%94%B1%E8%AE%BE%E7%BD%AE

/triage duplicate

@f2c-ci-robot f2c-ci-robot bot added the triage/duplicate Indicates an issue is a duplicate of other open issue. label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

2 participants