Given that definition, "mob rule" is not something to be prevented, but encouraged.
You may prefer some other system, and in many cases another system will likely lead to better outcomes, but that system is not Democracy.
To the original poster I say, you've spotted the root flaw in democracy. It does indeed allow everyone to vote, and many remain ignorant of the implications of what they are voting for, or are susceptible to manipulation.
You may attempt to fix these attributes in individual people (good luck with that) or you may thought-consider a system that is not democracy. What you can't do is change the system and call it democracy.