Rewriting pretty URLs with respect to the moved topic notice

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Rewriting pretty URLs with respect to the moved topic notice
« on March 29th, 2013, 07:36 PM »
So, I was testing a patch with respect to moved topic notices being excluded from RSS feeds (there's no need to syndicate them)

Now, I don't have topic URLs or board URLs prettified, but I do have profile names prettified from other testing I was doing (and set to localhost/wedge/profile/UserName/)

Anyway, so I did the redirect notice, and the body of the post notice has this when you look at it:

Code: [Select]
This topic has been moved to New Board

?topic=34.0

The latter part is a link to the post, and that works correctly, but the body text is being manipulated when it shouldn't be.

The post's physical content is:
Code: [Select]
This topic has been moved to [url=http://localhost/wedge/index.php?board=4.0]New Board[/url]<br><br>[iurl]http://localhost/wedge/index.php?topic=34.0[/iurl]

And that iurl tag is being rewritten to:
Code: [Select]
<a href="/wedge/index.php?topic=34.0" class="bbc_link raw">?topic=34.0</a>

The rewriter is rewriting things not actually in the innards of a tag, but inside the tag's contents.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,080
Re: Rewriting pretty URLs with respect to the moved topic notice
« Reply #1, on March 29th, 2013, 08:25 PM »
Uh... Okay... I can't reproduce, maybe I didn't understand how...
Have you tried removing the possible culprit, i.e. domain/protocol removal code from Subs-Template, around lines 535-540..? Try removing the first one, then the second, then both... See if it helps.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Nao

  • Dadman with a boy
  • Posts: 16,080

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Nao

  • Dadman with a boy
  • Posts: 16,080

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Rewriting pretty URLs with respect to the moved topic notice
« Reply #6, on April 1st, 2013, 03:00 AM »
Because what you're doing here is not what I'm doing on localhost.

Also, no, it's not just iurl tags. And yes it is the rewriter process.

I turned off all pretty URLs, did a redirect, worked as expected. Change the post to have:
Code: [Select]
[url]http://localhost/wedge/index.php?topic=37.0[/url]

Still worked as expected.

Then I turned pretty URLs on again, but *only* for profiles, and got the same behaviour.

Enabling it for topics is even more fucked up, however. Since for some reason, my given board has a 'url' of 'dummy678704' (no forwardslash) so everything breaks entirely. But even if I have the slash, it's all fecked because I'm not running it on a given domain, but in a folder, i.e. localhost/wedge/

Which says to me that rewrite URLs are currently broken if they only work at a top level folder. I seem to recall mentioning this before too. More than once, if I'm not mistaken. This is why I don't use PURLs, because it's *never* worked for me.