Small fixes for logging frmValidator

This commit is contained in:
Jonathan Jenne 2021-11-12 10:47:27 +01:00
parent 3114bfc123
commit 96456077e2
2 changed files with 9 additions and 7 deletions

View File

@ -67,10 +67,14 @@ Public Class clsPatterns
Return New Pattern(type, value).ToString Return New Pattern(type, value).ToString
End Function End Function
Public Shared Function ReplaceAllValues(input As String, panel As Panel, is_SQL As Boolean) As String Public Shared Function ReplaceAllValues(input As String, panel As Panel, is_SQL As Boolean) As String
Try Try
Dim result = input Dim result = input
If Not HasAnyPatterns(result) Then
Return result
End If
LOGGER.Debug($"input BEFORE replacing: [{result}]") LOGGER.Debug($"input BEFORE replacing: [{result}]")
result = ReplaceInternalValues(result) result = ReplaceInternalValues(result)
result = ReplaceControlValues(result, panel, is_SQL) result = ReplaceControlValues(result, panel, is_SQL)
@ -117,7 +121,6 @@ Public Class clsPatterns
oResult = ReplacePattern(oResult, PATTERN_INT, Now.ToShortDateString) oResult = ReplacePattern(oResult, PATTERN_INT, Now.ToShortDateString)
End While End While
LOGGER.Debug("pInput AFTER ReplaceInternalValues: " & pInput)
Return oResult Return oResult
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
@ -166,7 +169,6 @@ Public Class clsPatterns
End If End If
result = ReplacePattern(result, PATTERN_USER, CURRENT_CLICKED_PROFILE_TITLE) result = ReplacePattern(result, PATTERN_USER, CURRENT_CLICKED_PROFILE_TITLE)
End While End While
LOGGER.Debug("pInput AFTER ReplaceUserValues: " & input)
Return result Return result
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
@ -246,16 +248,15 @@ Public Class clsPatterns
oReplaceValue = ERROR_REPLACE_VALUE oReplaceValue = ERROR_REPLACE_VALUE
End Select End Select
If oIsSQL = True Then If oIsSQL = True Then
LOGGER.Debug($"IS_SQL = True - oReplaceValue = {oReplaceValue}") 'LOGGER.Debug($"IS_SQL = True - oReplaceValue = {oReplaceValue}")
'LOGGER.Debug($"oReplaceValue = {oReplaceValue}")
oReplaceValue = oReplaceValue.Replace("'", "''") oReplaceValue = oReplaceValue.Replace("'", "''")
LOGGER.Debug($"oReplaceValue = {oReplaceValue}")
End If End If
oResult = ReplacePattern(oResult, PATTERN_CTRL, oReplaceValue) oResult = ReplacePattern(oResult, PATTERN_CTRL, oReplaceValue)
End If End If
oTryCounter += 1 oTryCounter += 1
End While End While
LOGGER.Debug("pInput AFTER ReplaceControlValues: " & pInput)
Return oResult Return oResult
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
@ -290,7 +291,6 @@ Public Class clsPatterns
' Increase counter by 10 to avoid DDOSing the Windream Service ' Increase counter by 10 to avoid DDOSing the Windream Service
oTryCounter += 10 oTryCounter += 10
End While End While
LOGGER.Debug("sql AFTER ReplaceWindreamIndicies: " & pInput)
Return oResult Return oResult
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)

View File

@ -617,6 +617,8 @@ Public Class frmValidator
End If End If
'oSql = clsPatterns.ReplaceUserValues(sqlStatement, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID) 'oSql = clsPatterns.ReplaceUserValues(sqlStatement, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID)
'oSql = clsPatterns.ReplaceInternalValues(oSql) 'oSql = clsPatterns.ReplaceInternalValues(oSql)
oSQLStatement = clsPatterns.ReplaceAllValues(oSQLStatement, PanelValidatorControl, True) oSQLStatement = clsPatterns.ReplaceAllValues(oSQLStatement, PanelValidatorControl, True)
If IsNothing(oSQLStatement) Then If IsNothing(oSQLStatement) Then
Continue For Continue For