Refs: spip-team/securite#4839 (cherry picked from commit bbd88bd24a25e4e4aa9b0d12ff0124df8df9c4f1) (cherry picked from commit 0d4a43f8)