zenphoto/zenphoto — pull request #499 by SubJunk (2013-08-23 03:11:39+00:00)
Title: Make sure the incoming rating isn't higher than what is allowed

This is to stop users from adding very high rating values to images, which happened to one of my websites today.
Not sure if this is how you want it written but you get the logic anyway.