Fix for Nette on Mac #1

Open
wants to merge 2 commits into
from

Projects

None yet

2 participants

@juzna

Make the launcher work with Nette framework's Tracy, which does escaping by default.

@aik099
Owner

Hi,

Thanks for trying out this product. Did you like it?

You're talking about this line, right:
https://github.com/nette/tracy/blob/6e67928b3f8d0bc2124013f00db1f133bca6c849/src/Tracy/Helpers.php#L39 ?

This actually might be a bug in that library, because it does urlencode first to prevent url being corrupted in htmlspecialchars calls later on (in createHtml method).

You might want to report an issue on their side instead ;)

Also interesting if TextMate and other editors, which natively support custom protocol handling are working with https://github.com/nette/tracy.

@juzna

❤️ Loving it!

Yep as I'm looking at it, I'm guessing the path should not be escaped that much. But it works with TextMate.

@aik099
Owner

I'm using PHPStorm a lot and was surprised that they don't have custom protocol handler build-in as other editors do.

Googling about the subject revealed some ideas, but their either did work (due being very old) or not compatible with PHPStorm. So I decided to implement it myself, gladly such type of stuff can be done fairly easy on Mac.

In any case need to contact https://github.com/nette/tracy about the problem and investigate how other editors (except TextMate) working with https://github.com/nette/tracy provided links.

@juzna

I was looking into Tracy's history (previously it was part of Nette framework itself, only lately it got separated), and it's been there for very long time. Probably there was a reason? I guess other specials characters may need encoding in the URL.

Note that htmlspecialchars does not escape it again. And it is not enough, because URL needs to be escaped correctly by rawurlencode.

The app processing URLs shall be able to decode (de-encode) special chars. It PhpStormProtocol shall do the decoding.

@aik099
Owner

Probably spaces. However your code specifically replaced %2F, which encoded /. Maybe we need to fix same stuff, that is escaped by rawurlencode literally. Also on Windows path separators are `\' and your fix probably won't do anything.

@aik099
Owner

@juzna any success with this? You might want to do rawurldecode on the url before giving it to Regexp.

Or maybe using LinCastor alternative (https://github.com/aik099/PhpStormProtocol/blob/master/LinCastor.md).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment