Quote:
Originally Posted by JSWolf
Would it not also be good to search for href="page-template.xpgt" as well? That has to be there for no matter what else is there.
|
Short answer: No.
Long answer: Nnnnnnooooooooooooo.
Seriously, though: That routine works in basically two stages. First, it looks for LINK elements which have an HREF attribute and have a REL attribute which matches “stylesheet” or (now) “xpgt.” Once it builds that list, it then goes through and deletes all of those where the HREF attribute ends with “.xpgt.”
Therefore, the second test is already catching every possible *.xpgt filename. No good purpose is served by restricting it to “page-template.xpgt” instead or adding an additional check for that one filename in that stage. The problem, such as it was, existed with the first test, where “xpgt” was not an expected value and (I strongly suspect) is not a “legal” value, but clearly was used in at least one case.
As for foregoing the first test… really awful idea. I’ll grant that I cannot immediately think of a circumstance where an XPGT file can be linked to without being used as a template, but that’s the kind of approach that can go really wrong very fast.