Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Discussion URL parsing

LincLinc Admin
edited October 2009 in Vanilla 2.0 - 2.8
I propose that discussion URLs be stripped of periods and be converted to all lowercase.

Example: http://vanillaforums.org/discussion/10056/Unable-to-login-to-forum.-Unusual-cause...

I just pasted that into GitHub, and it parsed the URL with a "< /p" tacked on the end. One could argue that's sloppy coding on GitHub's part, but I don't think many people expect an ellipsis to end a URL. In my day-to-day travels around the interwibbles, I find a strong predilection for going all-lowercase and an overwhelming predilection for stripping periods.


(also, yes, fully aware of how low this probably falls on the priority list, just bringing it up)

Comments

  • MarkMark Vanilla Staff
    Great idea. I could have sworn we already got rid of periods. Anyway, here's the method that handles it in development. I've added a strtolower just now:

    public static function Url($Mixed) { if (!is_string($Mixed)) { return self::To($Mixed, 'Url'); } else { $Mixed = utf8_decode($Mixed); $Mixed = preg_replace('/-+/', '-', str_replace(' ', '-', trim(preg_replace('/([^\w\d_:.])/', ' ', $Mixed)))); $Mixed = utf8_encode($Mixed); return strtolower($Mixed); } }
  • Does anyone know if this has made it into production? My version is still a bit wonky with the ... in the title of a thread.
  • I have same problem.

    Especially with embedded forum.
    If i force it to be embedded, it fails.

    if i force it, it makes urls like this (it works ok while you are in iframe)
    site.com/forum#/index.php?p=/discussion/[id]/[url]

    and only this would work ok (even if you try to open in new tab/window)
    site.com/forum#/discussion/[id]/[url]

    So "open in new window" shows error as well as generated link in email. Since it adds that index.php always...

    but i can't and i don't know how to make those pretty URL's. There is some variable in config variables called prety urls (something like that) but changing that from FALSE to TRUE didn't help.
  • I am also experiencing the same issue and am having a very hard time finding a solution. Has anyone else had any luck with this?
Sign In or Register to comment.