sanitize gID

as discussed here https://github.com/concrete5/concrete5/pull/1772
and for 5.7 https://github.com/concrete5/concrete5-5.7.0/pull/157