I wonder if this ban addresses background checks covering the same information, because some companies do ask for this data from previous employers although not all provide it. Without protection there this ban seems fairly limited.
Anyhow, I don't agree with all advice to never disclose current/previous salary. In some scenarios certainly it makes sense, but in others it is the opposite. You want to justify a higher market value and set the expectation that you're unlikely to be interested unless they're willing to compensate at $X or higher. Of course it's different in terms of leverage if you're employed currently or not. Recruiters and interviewers will waste tons of your time if you don't get on the same page quickly. Lack of transparency around your compensation expectations will exacerbate this issue. Whether that means you tell them what you're making or what you'd like to make doesn't really matter, but you better do at least one of the two.