websvn icon indicating copy to clipboard operation
websvn copied to clipboard

Treat all filename extensions case-insensitive

Open danielmarschall opened this issue 2 years ago • 3 comments

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';
  • [x] Filename extensions already treated case-insensitively: Yes (because $extn is lowercase)
  • [ ] Mentioned in docs that extension configuration must be lower-case: (TODO)

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(
  • [x] Filename extensions already treated case-insensitively: Yes (because $extn is lowercase)
  • [ ] Mentioned in docs that extension configuration must be lower-case: (TODO)

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];
  • [x] Filename extensions already treated case-insensitively: Fixed in PR #201
  • [ ] Mentioned in docs that extension configuration must be lower-case: (TODO)

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) {
  • [x] Filename extensions already treated case-insensitively: Fixed in PR #201
  • [ ] Mentioned in docs that extension configuration must be lower-case: (TODO)

danielmarschall avatar Nov 13 '23 09:11 danielmarschall

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

michael-o avatar Nov 13 '23 10:11 michael-o

@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

danielmarschall avatar Dec 18 '23 22:12 danielmarschall

@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.

michael-o avatar Dec 19 '23 09:12 michael-o