The Article you quoted states the following:
6. Discussing Your Salary: Your employer can’t stop you from discussing your salary with your co-workers. The employers can’t prevent employees from discussing wages among themselves. Many employers have policies against this anyway, but these policies violate the law.
In a literal sense the employer cannot prevent employees from discussing their salary with co workers since he/she doesn't have eyes and ears everywhere. However it is incorrect to say such a policy violates the law,because the CIVIL CODE and LABOUR LAW make no mention of this.
In the absence of an agreement between the parties, it is not illegal to disclose salary details.
This would be different if a clause of nondisclosure of salary is stipulated in the OFFER LETTER.
To be clear the terms in the OFFER cannot be changed unless this is shown to be more advantageous to the EMPLOYEE.
On accepting the OFFER the employee has agreed to contractual obligation of non-disclosure and would be legally enforceable as followed through in the contract.
If an employee then discloses salary details it would be a breach of contract and of trust.
I don't see any court overturning such a clause, but it may modify or remove penalties if it considers them too extreme in relation to the breach.