mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Fix curl compatibility issues with colorize_url (#14615)
Also move the escape code safety check to guiOpenURL.
This commit is contained in:
parent
780543f0a2
commit
59bf1d8cd9
4 changed files with 36 additions and 20 deletions
|
@ -23,11 +23,19 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#define COLOR_CODE(color) "\x1b(c@" color ")"
|
||||
|
||||
#if USE_CURL
|
||||
#include <curl/curlver.h>
|
||||
// curl_url functions since 7.62.0
|
||||
#if LIBCURL_VERSION_NUM >= 0x073e00
|
||||
#define HAVE_COLORIZE_URL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_COLORIZE_URL
|
||||
|
||||
/**
|
||||
* Colorize URL to highlight the hostname and any unsafe characters
|
||||
* Colorize URL to highlight the hostname and any unsafe characters.
|
||||
*
|
||||
* Throws an exception if the url is invalid
|
||||
* Throws an exception if the url is invalid.
|
||||
*/
|
||||
std::string colorize_url(const std::string &url);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue