Modify

Opened 16 years ago

Closed 16 years ago

#1620 closed Bug (Fixed)

debug.au3: single(') quote problem.

Reported by: anonymous Owned by: J-Paul Mesnage
Milestone: 3.3.7.0 Component: Standard UDFs
Version: 3.3.6.1 Severity: None
Keywords: debug.au3 quotes Cc:

Description

file: debug.au3
function: __Debug_ReportWrite()

Problem: The $sData contend is not checked/adjusted for the precents of single(') quote-marks.
Needed to prevent the used function inside the Execute() function from failing on data strings that contain single quote marks.

input: $__gsReportCallBack_Debug = "ConsoleWrite("
input: $sData = " ' ' "
code: Execute($__gsReportCallBack_Debug & "'" & $sData & "')")
result: Execute(...) -> ConsoleWrite(' ' ' ') -> fails.

--- rest ---

Posible fix: (preceding Execute() line)

	If StringInStr($sData, "'") Then $sData = StringReplace($sData, "'", "''")
	;; or just
	$sData = StringReplace($sData, "'", "''")

Test code:

#include 'Debug.au3'
Enum $_logwin_ = 1, $_console_, $_msgbox_, $_file_
_DebugSetup(Default, False, $_console_, 'DebugOut.log')

$sTest = " '' " ;; returns " ' " as output.
_DebugReportVar('1) $sTest', $sTest)
_DebugOut('2) $sTest = ' & $sTest)
$sTest = " ' ' " ;; returns nothing, function inside execute() failed.
_DebugReportVar('3) $sTest', $sTest)
_DebugOut('4) $sTest = ' & $sTest)

Attachments (0)

Change History (1)

comment:1 by J-Paul Mesnage, 16 years ago

Milestone: 3.3.7.0
Owner: changed from Gary to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed by revision [5817] in version: 3.3.7.0

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.