Move redlink logic to PHP

Avoids extra JS variable.
Follows up 338c9cf1ac1065bb42865761b6b096edb704e89c

Bug: 66534
Change-Id: I13e3ef6662d606d5ccb85cb3603c5c54bd307a71