websvnphp / websvn

Fork from WebSVN
https://websvnphp.github.io/
GNU General Public License v2.0
137 stars 32 forks source link

Treat all filename extensions case-insensitive #206

Open danielmarschall opened 1 year ago

danielmarschall commented 1 year ago

As mentioned in #201 extensions extensions should be treated case insensitive.

I looked through the source code to find which configurable filename extensions there are, and if they are treated correctly.

Case $zipped

D:\GitHub\websvn\filedetails.php(74): if ($history && isset($zipped) && in_array($extn, $zipped) && $rep->hasReadAccess($path, false)) 
D:\GitHub\websvn\include\distconfig.php(266): // $zipped[] = '.dll';

Case $contentType

D:\GitHub\websvn\filedetails.php(88): // file, or from the $contentType array in setup.php.
D:\GitHub\websvn\filedetails.php(97): $setupContentType = @$contentType[$extn];
D:\GitHub\websvn\include\distconfig.php(298): // $contentType['.c'] = 'text/plain'; // Create a new association
D:\GitHub\websvn\include\distconfig.php(299): // $contentType['.doc'] = 'text/plain'; // Modify an existing one
D:\GitHub\websvn\include\distconfig.php(300): // unset($contentType['.m']); // Remove a default association
D:\GitHub\websvn\include\distconfig.php(304): // the file extension matches an entry in $contentType), you can choose to ignore
D:\GitHub\websvn\include\setup.php(60): $contentType = array(

Case $extEnscript

D:\GitHub\websvn\include\distconfig.php(394): // $extEnscript['.pas'] = 'pascal';
D:\GitHub\websvn\include\setup.php(191): $extEnscript = array(
D:\GitHub\websvn\include\svnlook.php(634): global $config, $extEnscript;
D:\GitHub\websvn\include\svnlook.php(640): if (array_key_exists($filename, $extEnscript)) {
D:\GitHub\websvn\include\svnlook.php(641): $lang = $extEnscript[$filename];
D:\GitHub\websvn\include\svnlook.php(642): } else if ($ext && array_key_exists($ext, $extEnscript)) {
D:\GitHub\websvn\include\svnlook.php(643): $lang = $extEnscript[$ext];

Case $extGeshi

D:\GitHub\websvn\include\distconfig.php(409): // $extGeshi['pascal'] = array('p', 'pas');
D:\GitHub\websvn\include\setup.php(263): $extGeshi = array(
D:\GitHub\websvn\include\svnlook.php(749): global $extGeshi;
D:\GitHub\websvn\include\svnlook.php(755): foreach ($extGeshi as $language => $extensions) {
michael-o commented 1 year ago

Thanks for the overview..now docs need to be fixed.

danielmarschall commented 11 months ago

@michael-o Thank you very much for mentioning me in the changelog :-) Much appreciated. I am sorry, I totally forgot about the docs. Will post a PR soon.

In your release description you accidentally wrote 2.8.2 instead of 2.8.3

michael-o commented 11 months ago

@michael-o Thank you very much for mentioning me in the changelog :-) Much appreciated.

Credits are well deserved!

I am sorry, I totally forgot about the docs. Will post a PR soon.

No need to excuse, take your time!

In your release description you accidentally wrote 2.8.2 instead of 2.8.3

Thanks, fixed.