Pages: 1
The code below will not allow "é". I get many errors after syncing.
"$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_. é\@\'\&\,\!]+$/';
Characters such as this are allowed in Adobe Lightroom, Photoshop, Illiustrator, Encore, Premiere, Picasa etc. I would think that for Piwigo to function in an international arena that special characters would be allowed in file naming. Must every file be renamed before uploading? For European languages this would seem to be an extreme limitation.
I see Piwigo as great open source software with many fabulous features, but this simple limitation would seem to be a large obstacle for many. The real word operates without such limitations to spelling. i realize that PHP and SQL have many restrictions but most people just want a beautiful gallery, they don't want deal with coding limitations.
I have been working through the limitations to file names in this post, but have received no response to my questions on special characters.
http://piwigo.org/forum/viewtopic.php?id=19881
Good cheers,
Thomas
Offline
OK .. This code did the job. The sync added all photos.
$conf['sync_chars_regex'] = '/^[[:alpha:][:digit:]-_.\sÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ!\(\)\&\/\°\'\,]+$/';
I installed fresh database, and still have this error after sync:
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's.07.12.01.jpg','Dinner at Lowe's.07.12.01','2012-08-26 19:18:25','./galleries/2' at line 137
INSERT INTO piwigo_images
(id,file,name,date_available,path,representative_ext,storage_category_id,added_by)
VALUES('1','Adventure Tour.03.12.01.jpg','Adventure Tour.03.12.01','2012-08-26 19:18:25','./galleries/2012/Mexico/Adventure Tour.03.12.01.jpg',NULL,'2','1')
, ('2','Adventure Tour.03.12.02.jpg','Adventure Tour.03.12.02','2012-08-26 19:18:25','./galleries/2012/Mexico/Adventure Tour.03.12.02.jpg',NULL,'2','1')
, ('3','Adventure Tour.03.12.03.jpg','Adventure Tour.03.12.03','2012-08-26 19:18:25','./galleries/2012/Mexico/Adventure Tour.03.12.03.jpg',NULL,'2','1')
, ('4','Adventure Tour.03.12.04.jpg','Adventure Tour.03.12.04','2012-08-26 19:18:25','./galleries/2012/Mexico/Adventure Tour.03.12.04.jpg',NULL,'2','1')
, ('5','Adventure Tour.03.12.05.jpg', in /home/content/55/2392255/html/gallery2/include/dblayer/functions_mysql.inc.php on line 770
Warning: Cannot modify header information - headers already sent by (output started at /home/content/55/2392255/html/gallery2/include/dblayer/functions_mysql.inc.php:769) in /home/content/55/2392255/html/gallery2/include/page_header.php on line 105
Offline
Now....unfortunately no photos show at all. Albums are there. Caddie says 339 photos, but all albums empty.
Start over......
Not sure if I will ever master this software.....
Offline
You can change of gallery software.
You have a ' in the name of the file : this character is not allowed
Offline
Just to inform you and let you know you're not alone: I've notified the dev who developed the multi size system, on your previous post.
Offline
Some details on special chars:
- ' (apos) and " (quote) - problems with html attributes / url encoding-decoding and database queries - could be corrected with some dev/extensive tests
- space,(,),[,],!,, and = will work from the next release (made a change here http://piwigo.org/dev/changeset/17315 and http://piwigo.org/dev/changeset/17316 )
- &, # - problems with url encoding-decoding - could be corrected with some dev/extensive tests
- accentuated characters - big issues to make it work correctly across all operating systems/file system types/php versions/web server types. Notably the issues are related to character encoding: utf-8 for piwigo php and database versus iso-8859 (how php interacts with the file system). This could be corrected but it requires heavy code changes in core and plugins ...
for more infos on this issue see:
http://stackoverflow.com/questions/1525 … -8-strings
http://www.rooftopsolutions.nl/blog/fil … ng-and-php
Offline
I used the following configuration and work fine for me:
$conf['sync_chars_regex'] = '/^[(a-zA-Z0-9-_.+&áéíóúàãõ@ )]+$/';
Last edited by rfreitaz (2013-07-17 15:24:35)
Offline
Do anyone have a update on this in 2020?
I have to use nordic letters and find this post trying to use the:
$conf['sync_chars_regex'] = '/^[[:alpha:][:digit:]-_.\sÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ!\(\)\&\/\°\'\,]+$/';
But that gives me allot of lines saying:
Warning: preg_match(): Compilation failed: invalid range in character class at offset 20 in /config/www/gallery/admin/site_update.php on line 225
(Beacuse of a Piwigo crash I had to rool back, but I would like to know the correct string to use in PHP 7.3.24?
Environment detail:
Styresystem: Linux
PHP: 7.3.24 (Vis info) [2020-11-08 22:22:00]
MySQL: 5.5.5-10.4.16-MariaDB-1:10.4.16+maria~bionic-log [2020-11-08 22:22:00]
Grafikbibliotek: ImageMagick 7.0.10-25
Offline
Okay this seem to do the trick just adding the ÆÅØ
$conf['sync_chars_regex'] = '/^[(a-zA-Z0-9-_. +&æøåáéíóúàãõ@ )]+$/';
Offline
Offset 20 is the minus hyphen in [:digit:]-_ so that is in a bad position, apparently PHP mistakes it as a range forming with the previous [:digit:] character set. You'd have to move the minus to the beginning or to the end of the expression or after a range set so it can't be mistaken. And do yourself a favour and don't include the \' apostrophe in the regex, or make sure it will never occur in directory names, otherwise it would make things fail.
Offline
Offset 20 is the minus hyphen in [:digit:]-_ so that is in a bad position, apparently PHP mistakes it as a range forming with the previous [:digit:] character set. You'd have to move the minus to the beginning or to the end of the expression or after a range set so it can't be mistaken. And do yourself a favour and don't include the \' apostrophe in the regex, or make sure it will never occur in directory names, otherwise it would make things fail.
This is the default value string:
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_. ]+$/';
Sorry kept getting errors reverted back to the simpler one:
$conf['sync_chars_regex'] = '/^[(a-zA-Z0-9-_. +&æÆøØåÅ@ )]+$/';
is this okay, would it be possible to add "&" I really dont want to mess up Piwigo but on the otherhand uploaded pictures from devices do have many different character's in them?
Is there a working example that would include most Western/Nordic characters
Is this the changes you would do?:
$conf['sync_chars_regex'] = '/^[[:alpha:][:digit:]_.\sÀÁÂÃÄÅÆàáâãäåæÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ!\(\)\&\/\°\,\-\,]+$/';
Again thanks for helping me out..... :-)
Offline
Hi, How dit it go? Did you solve this?
Offline
Pages: 1