View Single Post
Old 10-17-2019, 07:54 PM   #1317
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,077
Karma: 147983159
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Rev. Bob View Post
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.
The good thing is that the use of page-template.xpgt has dropped significantly. When Modify ePub was created, this horrible file was used a lot more. The eBook with this file was created sometime in 2014. And page-template is not used in any software other then RMSDK (ADE) and from what I saw, it may have only been used for margins which was a very stupid thing to do because margins should be set in CSS.
JSWolf is offline   Reply With Quote