Skip to content
Permalink
Browse files

Fix transfer_files2db db escaping (#95)

  • Loading branch information...
TotallyMehis committed Aug 30, 2019
1 parent cabc66a commit 2beef4ebc6983ff4ac034ba05794d2a9a92c9ea9
Showing with 6 additions and 2 deletions.
  1. +6 −2 addons/sourcemod/scripting/influx_transfer_files2db.sp
@@ -108,6 +108,7 @@ public void Thrd_Maps( Handle db, Handle res, const char[] szError, any data )
int mapid = SQL_FetchInt( res, 0 );
SQL_FetchString( res, 1, szMap, sizeof( szMap ) );

LogMessage( INF_CON_PRE..."Inserting map '%s' runs and zones to database...", szMap );


// Runs
@@ -128,7 +129,7 @@ public void Thrd_Maps( Handle db, Handle res, const char[] szError, any data )

kv.ExportToString( szData, sizeof( szData ) );

if ( !SQL_EscapeString( db, szData, szData, sizeof( szData ) ) )
if ( !Inf_DB_GetEscaped( db, szData, sizeof( szData ), "" ) )
{
LogError( INF_CON_PRE..."Failed to escape run data string! (%i)", runid );
continue;
@@ -164,7 +165,7 @@ public void Thrd_Maps( Handle db, Handle res, const char[] szError, any data )

kv.ExportToString( szData, sizeof( szData ) );

if ( !SQL_EscapeString( db, szData, szData, sizeof( szData ) ) )
if ( !Inf_DB_GetEscaped( db, szData, sizeof( szData ), "" ) )
{
LogError( INF_CON_PRE..."Failed to escape zone data string! (%i)", zoneid );
continue;
@@ -184,4 +185,7 @@ public void Thrd_Maps( Handle db, Handle res, const char[] szError, any data )

delete kv;
}


LogMessage( INF_CON_PRE..."Done inserting! Wait a moment for queries to finish." );
}

0 comments on commit 2beef4e

Please sign in to comment.
You can’t perform that action at this time.