mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
helpers: fix getBaseName() and getFileExt() for urls with query-strings
Origin commit data
------------------
Commit: e2b84f0259
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-02-15 (Sat, 15 Feb 2020)
Origin message was:
------------------
- helpers: fix getBaseName() and getFileExt() for urls with query-strings
This commit is contained in:
@@ -606,7 +606,9 @@ std::string getPathName(std::string &path)
|
|||||||
|
|
||||||
std::string getBaseName(std::string &path)
|
std::string getBaseName(std::string &path)
|
||||||
{
|
{
|
||||||
return _getBaseName(path, "/");
|
std::string p = path;
|
||||||
|
p = _getPathName(p, "?");
|
||||||
|
return _getBaseName(p, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getFileName(std::string &file)
|
std::string getFileName(std::string &file)
|
||||||
@@ -616,7 +618,9 @@ std::string getFileName(std::string &file)
|
|||||||
|
|
||||||
std::string getFileExt(std::string &file)
|
std::string getFileExt(std::string &file)
|
||||||
{
|
{
|
||||||
return _getBaseName(file, ".");
|
std::string f = file;
|
||||||
|
f = _getPathName(f, "?");
|
||||||
|
return _getBaseName(f, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user