View Single Post
Old 10-17-2019, 06:42 PM   #1316
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by JSWolf View Post
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.

Last edited by Rev. Bob; 10-17-2019 at 06:46 PM.
Rev. Bob is offline   Reply With Quote