Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[synchronization] Unable to synchronize directories starting with special names #201

Open
plegall opened this issue Jul 25, 2015 · 2 comments

Comments

@plegall
Copy link
Member

plegall commented Jul 25, 2015

Reported by gospogied on 2 Oct 2012 07:29

Version: 2.4.4

basename() is locale dependent so before it we must setlocale for special strings.

Steps to reproduce: 1. Edit
change in file include/config_default.inc.php line 743
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-.]+$/';
to
$conf['sync_chars_regex'] = '/^[a-zA-Z??ó????????Ó??????0-9-
. (),%+-~#@!*]+$/';
2. Create dir:
mkdir /PATH/TO/PIWIGO/galleries/?uk /PATH/TO/PIWIGO/galleries/luk /PATH/TO/PIWIGO/galleries/ku?
3. Synchronize.
Now You can see following albums in piwigo: uk luk ku?
So it ignores special characters in first positions.

The problem is in admin/site_update.php line 210.
To solve it you must add one line before it, for my language it is:

setlocale(LC_ALL, 'pl_PL.UTF-8');
$dir = basename($fulldir);

Additional information: Fixed by hand, but should be automated and probably basenames in other places also should be setlocaled first.

Piwigo Bugtracker #2758

@plegall plegall added the tweak label Jul 25, 2015
@plegall
Copy link
Member Author

plegall commented Jul 25, 2015

Comment posted by gospogied on 2 Oct 2012 08:15

It seems that bugtracker doesn't like locales, according to ????

@plegall
Copy link
Member Author

plegall commented Jul 25, 2015

Comment posted by m_alien on 31 Oct 2014 07:41

in piwigo 2.7.1 same broblem, and the same solution:

The problem is in admin/site_update.php line 210.
To solve it you must add one line before it, for my language it is:

setlocale(LC_ALL, 'ru_RU.UTF-8');
$dir = basename($fulldir);

and in i.php I add

setlocale(LC_ALL, 'ru_RU.UTF-8');

erAck added a commit to erAck/Piwigo that referenced this issue Nov 21, 2020
Dozens of forum threads resulting from confusion about what is and
what is not (and why not) allowed in sync_chars_regex indicate
there is some explanation needed. Do this in the default config so
that someone actually might read it.

Also see issues Piwigo#250 Piwigo#218 Piwigo#201 Piwigo#323
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants