[imp] [#30342] Small improvement in mod_custom to remove some hardcode
(Fix #879) Thanks Naouak and julienV