diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php
index fb8309844b2bed449c2862391ba84e1ef4e69bfe..357002bdc68837d8dbf235806009357bf95c9aac 100644
--- a/ecrire/inc/utils.php
+++ b/ecrire/inc/utils.php
@@ -2196,7 +2196,8 @@ function url_de_($http, $host, $request, $prof = 0) {
  *     - string : on transmet l'url à la fonction
  * @return string URL
  **/
-function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) {
+function generer_url_ecrire(?string $script = '', $args = '', $no_entities = false, $rel = false) {
+	$script ??= '';
 	if (!$rel) {
 		$rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT;
 	} else {