A potential employer can ask about your salary expectations. That’s reasonable. If you think the new job is worth $$$, ask for $$$. What they can’t do is ask your current salary, you say $$ and they offer your $$+20%. But even before this law, I have been in a habit of hanging up on recruiters or HR who ask.