« home   paste   Anonymous | Login | Signup for a new account 09-17-2019 12:16 CEST
* X »
GeSHi - Generic Syntax Highlighter Syntax Coloriser for PHP

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000105 [GeSHi] core tweak always 02-02-07 03:52 02-12-07 12:37
Reporter Knut View Status public  
Assigned To Knut
Priority high Resolution fixed  
Status closed   Product Version
Summary 0000105: GESHI_DIR_SEP deprecation
Description As of my to-come revision, I will deprecate GESHI_DIR_SEP. It will allways default to '/'.

The reason is, I've found that / works just fine on windows (at least XP pro).

What I want you to do, is (if you have windows, or mac, or anything) double-check that / works as dir separator. (Yes, I am aware that C:/ does not work on windoze, but we're not going to do absolute paths anyway, are we? They are different on linux and windoze!)

So please, check, double-check and triple check this.
Additional Information
Attached Files

- Relationships

- Notes
02-02-07 07:31

Although Windows supports '/' within paths I'm against the use of '/' as fixed constant as even PHP introduces a special constant for it. The reason we shouldn't rely on '/' to be working is (as mentioned above) C:/ won't work.

Assuming '/' to work on all platforms may introduce probable security flaws while checking against the base directory (to check if inclusion is allowed). Using '/' furthermore assumes side effects of Windows that we should not rely on as side-effect programming itself is deprecated ;-)
02-02-07 13:57

Hmm. The thing is, all includes are actually absolute paths, given that GESHI_ROOT or whatever it is is an absolute path.

What I am tempted to do is redefine GESHI_DIR_SEP as DIRECTORY_SEPARATOR, which is more platform independent really.

So perhaps efforts to remove this are misguided. Probably my fault, as someone suggested to me that it would work on windows for the 1.0.X branch. Thoughts, anyone?
02-02-07 17:29

@nigel: With that idea I can live better. For the redefinition.
02-06-07 04:22


What I do, is just to redefine it to the PHP constant. That will, at least, save some processing power, and make it a little more standardized.
02-06-07 09:34

Then I ACK on this.
02-11-07 08:07

This will be changed to an alias for DIRECTORY_SEPARATOR, and will be deprecated. It will remain for some while for backward compitability, but will ultimately be removed.
02-11-07 10:53

That isn't what was decided... we decided to re-alias the constant only, not to remove it later :p. Again, this is because GeSHi uses absolute include paths everywhere, so removing the constant would break it on windows. As much as I don't give a shit about windows, I don't think we intentionally have to break it here :)

I've re-committed class.geshi.php with the constant redefined.
02-12-07 08:31


What do you mean GeSHi uses absolute paths?
Does it really decide if it's on windoze or unix, work out if to use C:\ or /usr/var/www, and build up the absolute paths?
I allways thought it just included relatively. That's what I do, and it works :D
02-12-07 08:34

By the way, hwat I mean with removing it, is that there's no need to use the alias, when we can just use the php constant :D
02-12-07 10:47
edited on: 02-12-07 10:49

Well, GeSHi used absolut paths from the beginning, i.e. one of the main points for me to introduce the security check described in 0000015. This is heavily based on having GeSHi know from which directory it is run in order to prevent XSS and Remote Source Injection attacks. When now using GeSHi with relative paths this security would break down since GeSHi could not tell where it was ran from.

The last point why we should use correct absolute paths is to support older platforms like Win98 and Win95 that do not yet understand slashes in paths. Just as Nigel said: I don't really like Windows, but we don't have to forcefully work against it.

And at very last: I hate paths like C:\WinDooze/System32 ... They look horrible ...

But back to the constant: Having it be our own version of the constant we might introduce workarounds on path problems if they were to occure ...

Edit: This Bugtracker has an edit function for your own comments ;-) Would be nice to use it ;-)

02-12-07 12:37

Knut: yes, the paths are absolute, for the reasons that Ben described. And I think we should keep the constant as GESHI_DIR_SEP - it's shorter at the very least.

- Issue History
Date Modified Username Field Change
02-02-07 03:52 Knut New Issue
02-02-07 07:31 BenBE Note Added: 0000488
02-02-07 13:57 nigel Note Added: 0000489
02-02-07 17:29 BenBE Note Added: 0000490
02-06-07 04:22 Knut Note Added: 0000491
02-06-07 04:22 Knut Assigned To  => Knut
02-06-07 04:22 Knut Status new => assigned
02-06-07 09:34 BenBE Note Added: 0000492
02-11-07 08:07 Knut Status assigned => resolved
02-11-07 08:07 Knut Resolution open => fixed
02-11-07 08:07 Knut Note Added: 0000497
02-11-07 10:53 nigel Note Added: 0000498
02-12-07 08:31 Knut Note Added: 0000503
02-12-07 08:34 Knut Note Added: 0000504
02-12-07 10:47 BenBE Note Added: 0000505
02-12-07 10:49 BenBE Note Edited: 0000505
02-12-07 12:37 nigel Status resolved => closed
02-12-07 12:37 nigel Note Added: 0000506
02-12-07 12:37 nigel Fixed in Version  => 1.1.2alpha4


Mantis 1.0.0rc2[^]
Copyright © 2000 - 2005 Mantis Group
53 total queries executed.
38 unique queries executed.
Powered by Mantis Bugtracker