diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php
index f20c4ccb358a50b98140394996e901c0eea980ce..d465d795b9b00d916639dc54a69df66c2f4332d9 100644
--- a/ecrire/inc/utils.php
+++ b/ecrire/inc/utils.php
@@ -1514,6 +1514,12 @@ function find_all_in_path($dir, $pattern, $recurs = false) {
 	$liste_fichiers = array();
 	$maxfiles = 10000;
 
+	// cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue
+	// on a pas encore inclus flock.php
+	if (!function_exists('preg_files')) {
+		include_once _ROOT_RESTREINT . 'inc/flock.php';
+	}
+
 	// Parcourir le chemin
 	foreach (creer_chemin() as $d) {
 		$f = $d . $dir;