mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 05:57:45 +00:00
Merge remote-tracking branch 'refs/remotes/SapphireMordred/master' into last_warnings
This commit is contained in:
commit
9c13feb9c5
1 changed files with 3 additions and 3 deletions
|
@ -597,7 +597,7 @@ int main(int argc, char* argv[])
|
|||
auto path = boost::filesystem::canonical( web_root_path / "news.xml" );
|
||||
//Check if path is within web_root_path
|
||||
if( distance( web_root_path.begin(), web_root_path.end() ) > distance( path.begin(), path.end() ) ||
|
||||
!std::equal( web_root_path.begin(), web_root_path.end(), path.begin(), path.end() ) )
|
||||
!std::equal( web_root_path.begin(), web_root_path.end(), path.begin() ) )
|
||||
throw invalid_argument( "path must be within root path" );
|
||||
if( !( boost::filesystem::exists( path ) && boost::filesystem::is_regular_file( path ) ) )
|
||||
throw invalid_argument( "file does not exist" );
|
||||
|
@ -638,7 +638,7 @@ int main(int argc, char* argv[])
|
|||
auto path = boost::filesystem::canonical( web_root_path / "headlines.xml" );
|
||||
//Check if path is within web_root_path
|
||||
if( distance( web_root_path.begin(), web_root_path.end() ) > distance( path.begin(), path.end() ) ||
|
||||
!std::equal( web_root_path.begin(), web_root_path.end(), path.begin(), path.end() ) )
|
||||
!std::equal( web_root_path.begin(), web_root_path.end(), path.begin() ) )
|
||||
throw invalid_argument( "path must be within root path" );
|
||||
if( !( boost::filesystem::exists( path ) && boost::filesystem::is_regular_file( path ) ) )
|
||||
throw invalid_argument( "file does not exist" );
|
||||
|
@ -683,7 +683,7 @@ int main(int argc, char* argv[])
|
|||
auto path = boost::filesystem::canonical( web_root_path / request->path );
|
||||
//Check if path is within web_root_path
|
||||
if( distance( web_root_path.begin(), web_root_path.end() ) > distance( path.begin(), path.end() ) ||
|
||||
!std::equal( web_root_path.begin(), web_root_path.end(), path.begin(), path.end() ) )
|
||||
!std::equal( web_root_path.begin(), web_root_path.end(), path.begin() ) )
|
||||
throw invalid_argument( "path must be within root path" );
|
||||
if( boost::filesystem::is_directory( path ) )
|
||||
path /= "index.html";
|
||||
|
|
Loading…
Add table
Reference in a new issue