diff options
author | madmaxoft <github@xoft.cz> | 2014-07-17 22:50:58 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-17 22:50:58 +0200 |
commit | 5e198c673009cf8ca9d92cf59848999bc96bbc37 (patch) | |
tree | e75f01b222867e2ff08b4390fb66f084521606da /src/Bindings/WebPlugin.cpp | |
parent | Merge branch 'master' of https://github.com/mc-server/MCServer (diff) | |
download | cuberite-5e198c673009cf8ca9d92cf59848999bc96bbc37.tar cuberite-5e198c673009cf8ca9d92cf59848999bc96bbc37.tar.gz cuberite-5e198c673009cf8ca9d92cf59848999bc96bbc37.tar.bz2 cuberite-5e198c673009cf8ca9d92cf59848999bc96bbc37.tar.lz cuberite-5e198c673009cf8ca9d92cf59848999bc96bbc37.tar.xz cuberite-5e198c673009cf8ca9d92cf59848999bc96bbc37.tar.zst cuberite-5e198c673009cf8ca9d92cf59848999bc96bbc37.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/WebPlugin.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Bindings/WebPlugin.cpp b/src/Bindings/WebPlugin.cpp index bc1a9ac8c..57ed9f6a4 100644 --- a/src/Bindings/WebPlugin.cpp +++ b/src/Bindings/WebPlugin.cpp @@ -64,27 +64,27 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest std::pair< AString, AString > Names; AStringVector Split = StringSplit(a_Request->Path, "/"); - if( Split.size() > 1 ) + if (Split.size() > 1) { - sWebPluginTab* Tab = 0; - if( Split.size() > 2 ) // If we got the tab name, show that page + sWebPluginTab * Tab = NULL; + if (Split.size() > 2) // If we got the tab name, show that page { for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) { - if( (*itr)->SafeTitle.compare( Split[2] ) == 0 ) // This is the one! Rawr + if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one! { Tab = *itr; break; } } } - else // Otherwise show the first tab + else // Otherwise show the first tab { if( GetTabs().size() > 0 ) Tab = *GetTabs().begin(); } - if( Tab ) + if (Tab != NULL) { Names.first = Tab->Title; Names.second = Tab->SafeTitle; @@ -97,13 +97,13 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest -AString cWebPlugin::SafeString( const AString & a_String ) +AString cWebPlugin::SafeString(const AString & a_String) { AString RetVal; for( unsigned int i = 0; i < a_String.size(); ++i ) { char c = a_String[i]; - if( c == ' ' ) + if( c == ' ' ) { c = '_'; } @@ -111,3 +111,7 @@ AString cWebPlugin::SafeString( const AString & a_String ) } return RetVal; } + + + + |