Fix generating URL issue with type check

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2018-03-19 10:24:31 +01:00
parent 7ffd7f0b21
commit eadf775bb3

View File

@ -88,7 +88,7 @@ class Utils {
*/ */
public static function getUrlSondage($id, $admin = false, $vote_id = '', $action = null, $action_value = null) { public static function getUrlSondage($id, $admin = false, $vote_id = '', $action = null, $action_value = null) {
// URL-Encode $action_value // URL-Encode $action_value
$action_value = $action_value === null ? null : Utils::base64url_encode($action_value); $action_value = $action_value ? null : Utils::base64url_encode($action_value);
if (URL_PROPRE) { if (URL_PROPRE) {
if ($admin === true) { if ($admin === true) {
@ -98,8 +98,8 @@ class Utils {
} }
if ($vote_id !== '') { if ($vote_id !== '') {
$url .= '/vote/' . $vote_id . "#edit"; $url .= '/vote/' . $vote_id . "#edit";
} elseif ($action !== null) { } elseif ($action) {
if ($action_value !== null) { if ($action_value) {
$url .= '/action/' . $action . '/' . $action_value; $url .= '/action/' . $action . '/' . $action_value;
} else { } else {
$url .= '/action/' . $action; $url .= '/action/' . $action;