(re) Allow accents in names

This commit is contained in:
Olivier PEREZ 2015-01-13 08:08:43 +01:00
parent 08a3fe1b69
commit e9b456ad6e
6 changed files with 10 additions and 4 deletions

View File

@ -165,7 +165,7 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
$choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => CHOICE_REGEX]]);
if (empty($name)) {
$message = new Message('danger', _('Name is incorrect.'));
$message = new Message('danger', _('The name is invalid.'));
}
if (count($choices) != count($_POST['choices'])) {
$message = new Message('danger', _('There is a problem with your choices.'));
@ -223,7 +223,7 @@ if (isset($_POST['add_comment'])) {
$comment = strip_tags($_POST['comment']);
if (empty($name)) {
$message = new Message('danger', _('Name is incorrect.'));
$message = new Message('danger', _('The name is invalid.'));
}
if ($message == null) {

View File

@ -58,7 +58,7 @@ $ALLOWED_LANGUAGES = [
// Regex
const POLL_REGEX = '/^[a-z0-9]+$/';
const CHOICE_REGEX = '/^[012]$/';
const NAME_REGEX = '/(*UTF8)^[[:alnum:]_ -]+$/i';
const NAME_REGEX = '/^[áàâäãåçéèêëíìîïñóòôöõúùûüýÿæœa-z0-9_ -]+$/i';
// Path to logo
const LOGOBANDEAU = '<relative path to the logo file>';

Binary file not shown.

View File

@ -265,6 +265,9 @@ msgstr "Save the new rules"
msgid "Cancel the rules edit"
msgstr "Cancel the rules edit"
msgid "The name is invalid."
msgstr "Le nom n'est pas valide."
# Help text adminstuds.php
msgid "As poll administrator, you can change all the lines of this poll with this button"
msgstr "As poll administrator, you can change all the lines of this poll with this button"

Binary file not shown.

View File

@ -265,6 +265,9 @@ msgstr "Enregistrer les nouvelles permissions"
msgid "Cancel the rules edit"
msgstr "Annuler le changement de permissions"
msgid "The name is invalid."
msgstr "Le nom n'est pas valide."
# Help text adminstuds.php
msgid "As poll administrator, you can change all the lines of this poll with this button"
msgstr "En tant qu'administrateur, vous pouvez modifier toutes les lignes de ce sondage avec ce bouton"