Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
166 stars 7 forks source link

XML Include/Script elements can load unexpected files #423

Open Meorawr opened 1 year ago

Meorawr commented 1 year ago

XML <Include file=""> and <Script file=""> elements if supplied file names that don't exist in their current directory results in the client instead attempting to locate and load the named file from the top-level directory of an addon, rather than just erroring and complaining that the file doesn't exist.

This issue is possibly new since Dragonflight as it only occurs on the 10.x and Wrath (3.4.1) clients. It does not affect Classic Era (1.14.0). A test case addon is provided.

Test case

  1. Install the following addon and log into the game: Meorawr_XMLPathLoadTest.zip
  2. Check the messages printed to the chat frame. You should only see two lines for "Loaded: Directory\Script2.lua". You should not see "Loaded: Script1.lua" or "Loaded: Script2.lua".

On the Dragonflight (10.0.7) and Wrath (3.4.1) clients you'll see the following output - indicating that an <Script file="Script1.lua"/> element in Directory\File.xml resulted in the "Script1.lua" file from the parent directory being loaded.

image

On Classic Era (1.14.3) the behaviour is different - the "Script1.lua" file won't be loaded as it doesn't exist.

image

ferronn-dev commented 1 year ago

Note that this behavior is required in order to correctly interpret 3.4.2.49979 (current wow_classic_ptr build).