robots.php: Simplify Last-Modified logic and re-use code

Trivial refactor without changing any of the effective code or which
functions are used.

Change-Id: I67d30d69a760b484e195aa57039cb6ec381063a8