Commit 976250ce authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

utils: Url: Split safe characters detection in a specific function

parent eead6f2c
......@@ -29,6 +29,14 @@
#include <stdexcept>
#include <cstdlib>
namespace
{
inline bool isSafe( char c )
{
return c == '.' || c == '-' || c == '_' || c == '~' || c == '/';
}
}
namespace medialibrary
{
namespace utils
......@@ -72,7 +80,7 @@ std::string encode( const std::string& str )
( c >= 'a' && c <= 'z' ) ||
( c >= 'A' && c <= 'Z' ) ||
( c >= '0' && c <= '9' ) ||
c == '.' || c == '-' || c == '_' || c == '~' || c == '/' )
isSafe( c ) == true )
)
{
res.push_back( c );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment