Hi,
when adding an accentuated char 'é' in permitted characters, you can import directories and files with this char. Great.
// permitted characters for files/directories during synchronization
$conf['sync_chars_regex'] = '/^[a-zéA-Z0-9-_.]+$/';
There is a remaining problem when this accentuated char is the first one in the name of a directory, because this makes this directory to be imported as a new one everytimes you sync.
The problem is coming from PHP basename function, which depends on locale, and maybe on the system itself. I thought this problem was a poor utf8 support. https://github.com/Piwigo/Piwigo/blob/1233694048c47910432c3c29b81338fed73516c5/admin/site_update.php#L236
My workaround was simply to replace it with that function, declared before the loop:
NB: As $suffix is not handled, one may found a much better basename replacement.
Hi,
when adding an accentuated char 'é' in permitted characters, you can import directories and files with this char. Great.
```
// permitted characters for files/directories during synchronization
$conf['sync_chars_regex'] = '/^[a-zéA-Z0-9-_.]+$/';
```
There is a remaining problem when this accentuated char is the first one in the name of a directory, because this makes this directory to be imported as a new one everytimes you sync.
The problem is coming from PHP basename function, which depends on locale, and maybe on the system itself. I thought this problem was a poor utf8 support.
https://github.com/Piwigo/Piwigo/blob/1233694048c47910432c3c29b81338fed73516c5/admin/site_update.php#L236
My workaround was simply to replace it with that function, declared before the loop:
```
function my_utf8_simili_basename($path, $suffix='') {
$tab = explode('/', rtrim($path, '/'));
return end($tab);
}
```
_NB: As $suffix is not handled, one may found a much better basename replacement._
<!-- github-sync-id:819851570 -->
The problem seems lighter for files starting with an accentuated letter, indeed they are not imported again during following synchronizations. For instance, picture page is only missing the first char in displaying name, picture display is fine.
The problem seems lighter for files starting with an accentuated letter, indeed they are not imported again during following synchronizations. For instance, picture page is only missing the first char in displaying name, picture display is fine.
<!-- github-comment-id:788842298 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hi,
when adding an accentuated char 'é' in permitted characters, you can import directories and files with this char. Great.
There is a remaining problem when this accentuated char is the first one in the name of a directory, because this makes this directory to be imported as a new one everytimes you sync.
The problem is coming from PHP basename function, which depends on locale, and maybe on the system itself. I thought this problem was a poor utf8 support.
https://github.com/Piwigo/Piwigo/blob/1233694048c47910432c3c29b81338fed73516c5/admin/site_update.php#L236
My workaround was simply to replace it with that function, declared before the loop:
NB: As $suffix is not handled, one may found a much better basename replacement.
This mb_basename function is closer to basename function
https://stackoverflow.com/questions/32115609/basename-fail-when-file-name-start-by-an-accent/66438414#66438414
The problem seems lighter for files starting with an accentuated letter, indeed they are not imported again during following synchronizations. For instance, picture page is only missing the first char in displaying name, picture display is fine.