read_locations will no longer silently process a mismatched list of
x and y integers as a valid path, instead it will throw a
bad_lexical_cast. gfgtdf and I discussed on irc, we don't believe
that this will break save or replay compatibility, and it could
potentially help to catch possible OOS bugs in the future. I am
currently passing all my C++ and WML unit tests with this commit.
This commit also changes the [command] [move] handler over to use
this function directly without checking for mismatched lists, so
if this commit is reverted that function will still work correctly.
Move a bool flag that remembers if we threw an exception, to be a
local static variable in that function, rather than at file scope.
This ensures that no other functions will mess with it.
The move implementation used a function from map_location.cpp,
parse_location_range. This has the consequence that if the move tag
has mismatched numbers of entries for x and y, it is not reported
as an error and instead some truly bizarre, although not "undefined"
behavior ensues. Since this has obvious potential to conceal bugs
and no obvious benefit, I have changed this to a more sane
implementation. See chat log today with gfgtdf for full details.
Let's see if this breaks some absurd border case I couldn't think of.
Quick testing revealed that early initialization, campaignd, and
wesnothd at least did not fail the assertion check.
Fixes a file content disclosure bug (#22042) affecting functionality
relying on the get_wml_location() function and not passing a non-empty
value for the current_dir parameter.
See <https://gna.org/bugs/?22042> for details.
This is a candidate for the 1.10 and 1.12 branches.
Those who are updating from old UMC may otherwise be caught unawares by the
change from defaulting to side 1 when the side key is missing, to all
sides. Later we will have an option to turn off this warning.
Since the insertion of an attribute line is now commented out, it may be
questioned whether this still belongs in hack_syntax. However, at some
point the plan is to give users an option to insert the side= key.
Those who are updating from old UMC may otherwise be caught unawares by the
change from defaulting to side 1 when the side key is missing, to all
sides. Later we will have an option to turn off this warning.
First, a couple of extraneous quotes were left in the second regex around
"</a>".
Second, it is possible that a period or question mark could be used to end
a sentence, rather than be part of the URL. So check that these characters
are followed by an alphanumeric character to make them part of the URL.
Per discussion with Elvish Hunter on the forum. Having dryrun check for a
minimum verbosity level during the options for loop meant that -vd would
set the verbosity level to 1, while -dv would set it to 2.