X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_mysql.cpp;h=45ba67e4ebf23d48b53f5e99313246afff38292a;hb=97a1d6429a735eb279496df010d04e3f42aa4e22;hp=0a7d4d993ce6d78a4e5c91d7d86e15fa004bac4d;hpb=780dda83ba3857bc3c330d4b5d38bb251a9d879b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 0a7d4d993..45ba67e4e 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -356,10 +356,9 @@ class SQLConnection : public SQL::Provider // and one byte is the terminating null std::vector buffer(parm.length() * 2 + 1); - // The return value of mysql_escape_string() is the length of the encoded string, + // The return value of mysql_real_escape_string() is the length of the encoded string, // not including the terminating null - unsigned long escapedsize = mysql_escape_string(&buffer[0], parm.c_str(), parm.length()); -// mysql_real_escape_string(connection, queryend, paramscopy[paramnum].c_str(), paramscopy[paramnum].length()); + unsigned long escapedsize = mysql_real_escape_string(connection, &buffer[0], parm.c_str(), parm.length()); res.append(&buffer[0], escapedsize); } } @@ -428,7 +427,7 @@ void ModuleSQL::ReadConfig(ConfigStatus& status) ConfigTagList tags = ServerInstance->Config->ConfTags("database"); for(ConfigIter i = tags.first; i != tags.second; i++) { - if (i->second->getString("module", "mysql") != "mysql") + if (!stdalgo::string::equalsci(i->second->getString("provider"), "mysql")) continue; std::string id = i->second->getString("id"); ConnMap::iterator curr = connections.find(id);