Yes, it is illegal in law. Maternity leave can be employed by an employer and an employee is not allowed to chase out must receive their normal salary.
Yes, it's illegal in the law on maternity leave the employee can be dismissed by the employer and the employee has no right to receive a regular salary.