Fix the override of the 'create' value

This commit is contained in:
Gregory Trolliet 2020-11-26 16:59:44 +01:00
parent 76ab05c8c7
commit 31d43467ce
3 changed files with 4 additions and 5 deletions

View file

@ -24,12 +24,11 @@ if (empty($_POST)) {
<label for="fsize"><?php echo L::cloud_size ?></label>
<input type="number" id="fsize" name="fsize" min="1" max="9" value=<?php echo DataBase::DEFAULT_SIZE ?>>
</div>
<input type="submit" id="cloud_create_submit" value="<?php echo L::create ?>">
<input type="submit" id="cloud_create_submit" value="<?php echo L::create_button ?>">
</form>
</div>
<?php
} else {
/*$token = bin2hex(random_bytes(DataBase::CLOUD_CODE_LENGTH));*/
if (isset($_POST['fsize']) && is_numeric($_POST['fsize'])) {
$size = $_POST['fsize'];
} else {
@ -45,7 +44,7 @@ if (empty($_POST)) {
} else {
$duration = DataBase::DEFAULT_DURATION;
}
if ($cloud = $db->createCloud($text, $size, $duration)) {
$viewUrl = 'result.php?id=' . $cloud['code'];
$viewName = 'https://' . $_SERVER['HTTP_HOST'] . '/' . $viewUrl;

View file

@ -29,7 +29,7 @@ if (isset($_GET['id'])) {
?>
<p><?php echo L::cloud_create_message ?></p>
<form method="post" action="create.php">
<input type="submit" value="<?php echo L::create ?>">
<input type="submit" value="<?php echo L::create_button ?>">
</form>
<?php
}

View file

@ -18,7 +18,6 @@
title = "SimpleWordsCloud"
description = "Création de nuage de mots, simple, sans inscriptions et respectant la vie privée"
create = "Créer"
[cloud]
description = "Description du nuage"
@ -47,6 +46,7 @@ cloudNotFound = "Le nuage <em>%s</em> n'a pas été trouvé, veuillez vérifier
[create]
errorCode = "Erreur lors de la création du nuage, désolé du dérangement."
button = "Créer"
[duration]
day = "un jour"