Revert "Revert "Disallow specifying file paths with backslashes""

This reverts commit 02de08338c0f31b79f1a6604fe7470ee77471323.

Mainline does *not* contain paths with backslashes. If it did, the game
would be broken on GNU/Linux and macOS (and we'd need to fix it anyway).
Instead, it's more likely that we have code somewhere that generates
paths dynamically using backslashes on Windows, and the correct fix is
to change that code to use forward slashes instead.
This commit is contained in:
Jyrki Vesterinen 2017-10-28 19:25:30 +03:00
parent e4412d2646
commit c57b9a8f90
3 changed files with 9 additions and 7 deletions

View File

@ -16,30 +16,24 @@ CHANGES
[rasection="Campaigns"]
[list]
[*]The order of the beginner campaigns is now [i]A Tale of Two Brothers, An Orcish Incursion, The South Guard, & Heir to the Throne.[/i] It is hoped that this sequence will be friendlier to new players, encouraging them to start with the simpler AToTB, so they might be better prepared to enjoy HttT.
[/list]
[/rasection]
[rasection="User Interface"]
[list]
[*]Most text boxes now support advanced Input Method Editors (in-game chat does not, however).
[/list]
[/rasection]
[rawarn="Deprecations and breaking changes"]
[list]
[*] moveto and enter_hex, exit_hex event no longer abort the movement, [cancel_action] must be used to cancel the current move.
[*] The allow_new_game= attribute in [scenario] now defaults to false (it still defaults to tru in [multiplayer])
[*] In gui2 dialogs/widgets [resolution] window_width/height now specifies the minimum window size for that resolution ot be chosen
[*] File paths with backslashes are no longer accepted. Use forward slashes instead.
[/list]
[/rawarn]
[rasection="New lua/wml features"]
[list]
[*] formula code is now supported in abilities and weapon specials
[*] [multiplayer]/[scenario] now support mp_village_gold, mp_village_support, mp_fog and mp_shroud keys, which are useed as default values for the corresponding keys in [side], it is reccomended to use them instead of the keys in [side] for configurable multiplayer scenarios.
[/list]
[/rasection]

View File

@ -6,6 +6,9 @@ Version 1.13.10+dev:
* Fixed a bug that partially prevented movement feedback announce messages
to be displayed (UI regression bug #2130, affecting 1.13.8 and 1.13.10).
* WML Engine:
* File paths with backslashes are no longer allowed. This ensures that a UMC
author can't accidentally use them and make an add-on that breaks on
GNU/Linux and macOS.
* File paths are now case sensitive even on Windows.
Version 1.13.10:

View File

@ -1147,6 +1147,11 @@ static bool is_legal_file(const std::string &filename)
return false;
}
if (filename.find('\\') != std::string::npos) {
ERR_FS << "Illegal path '" << filename << R"end(' ("\" not allowed, for compatibility with GNU/Linux and macOS).)end" << std::endl;
return false;
}
if (looks_like_pbl(filename)) {
ERR_FS << "Illegal path '" << filename << "' (.pbl files are not allowed)." << std::endl;
return false;