xcbosa-itx пре 2 година
родитељ
комит
482028ad2e
4 измењених фајлова са 7 додато и 7 уклоњено
  1. 1 1
      controller/LoginController.cpp
  2. 2 2
      user.hpp
  3. 3 3
      utils/INI.cpp
  4. 1 1
      utils/RequestData.cpp

+ 1 - 1
controller/LoginController.cpp

@@ -39,7 +39,7 @@ namespace xc::controller {
         });
         });
     }
     }
 
 
-    ContentGeneratorDefineWithNameS("LoginController", request.getURLPath() == "/", LoginController(request))
+    ContentGeneratorDefineWithNameS("LoginController", false, LoginController(request))
 
 
     ResponseData *ValidAuthController(RequestData request) {
     ResponseData *ValidAuthController(RequestData request) {
         string arg = request.getURLArgument("v");
         string arg = request.getURLArgument("v");

+ 2 - 2
user.hpp

@@ -42,7 +42,7 @@ namespace user {
         return "";
         return "";
     }
     }
 
 
-    inline vector<string> split(const string& str, const string& delim) __attribute__((weak)) {
+    static vector<string> split(const string& str, const string& delim) {
         vector<string> res;
         vector<string> res;
         if ("" == str) return res;
         if ("" == str) return res;
         char * strs = new char[str.length() + 1];
         char * strs = new char[str.length() + 1];
@@ -58,7 +58,7 @@ namespace user {
         return res;
         return res;
     }
     }
 
 
-    inline std::string& trim(std::string &s) __attribute__((weak)) {
+    static std::string& trim(std::string &s) {
         if (s.empty()) { return s; }
         if (s.empty()) { return s; }
         s.erase(0,s.find_first_not_of(" "));
         s.erase(0,s.find_first_not_of(" "));
         s.erase(s.find_last_not_of(" ") + 1);
         s.erase(s.find_last_not_of(" ") + 1);

+ 3 - 3
utils/INI.cpp

@@ -8,7 +8,7 @@
 namespace xc {
 namespace xc {
     namespace utils {
     namespace utils {
 
 
-        vector<string> split(const string& str, const string& delim) {
+        static vector<string> split(const string& str, const string& delim) {
             vector<string> res;
             vector<string> res;
             if ("" == str) return res;
             if ("" == str) return res;
             char * strs = new char[str.length() + 1];
             char * strs = new char[str.length() + 1];
@@ -24,7 +24,7 @@ namespace xc {
             return res;
             return res;
         }
         }
 
 
-        string& replace_all(string& src, const string& old_value, const string& new_value) {
+        static string& replace_all(string& src, const string& old_value, const string& new_value) {
             for (string::size_type pos(0); pos != string::npos; pos += new_value.length()) {
             for (string::size_type pos(0); pos != string::npos; pos += new_value.length()) {
                 if ((pos = src.find(old_value, pos)) != string::npos) {
                 if ((pos = src.find(old_value, pos)) != string::npos) {
                     src.replace(pos, old_value.length(), new_value);
                     src.replace(pos, old_value.length(), new_value);
@@ -34,7 +34,7 @@ namespace xc {
             return src;
             return src;
         }
         }
 
 
-        std::string& trim(std::string &s) {
+        static std::string& trim(std::string &s) {
             if (s.empty()) { return s; }
             if (s.empty()) { return s; }
             s.erase(0,s.find_first_not_of(" "));
             s.erase(0,s.find_first_not_of(" "));
             s.erase(s.find_last_not_of(" ") + 1);
             s.erase(s.find_last_not_of(" ") + 1);

+ 1 - 1
utils/RequestData.cpp

@@ -131,7 +131,7 @@ namespace xc {
             if (cookies.empty()) { return ""; }
             if (cookies.empty()) { return ""; }
             vector<string> cookieList = split(cookies, ";");
             vector<string> cookieList = split(cookies, ";");
             for (string cookie : cookieList) {
             for (string cookie : cookieList) {
-                auto items = split(cookies, "=");
+                auto items = split(cookie, "=");
                 if (items.size() == 2) {
                 if (items.size() == 2) {
                     string name = items[0];
                     string name = items[0];
                     string value = items[1];
                     string value = items[1];