@@ -301,9 +301,8 @@ public function getDataFromName($name): array|null
301301 $ columns = '`EVENT_NAME`, `STATUS`, `EVENT_TYPE`, `EXECUTE_AT`, '
302302 . '`INTERVAL_VALUE`, `INTERVAL_FIELD`, `STARTS`, `ENDS`, '
303303 . '`EVENT_DEFINITION`, `ON_COMPLETION`, `DEFINER`, `EVENT_COMMENT` ' ;
304- $ where = 'EVENT_SCHEMA ' . Util::getCollateForIS () . '= '
305- . "' " . $ this ->dbi ->escapeString ($ GLOBALS ['db ' ]) . "' "
306- . "AND EVENT_NAME=' " . $ this ->dbi ->escapeString ($ name ) . "' " ;
304+ $ where = 'EVENT_SCHEMA ' . Util::getCollateForIS () . '= ' . $ this ->dbi ->quoteString ($ GLOBALS ['db ' ])
305+ . ' AND EVENT_NAME= ' . $ this ->dbi ->quoteString ($ name );
307306 $ query = 'SELECT ' . $ columns . ' FROM `INFORMATION_SCHEMA`.`EVENTS` WHERE ' . $ where . '; ' ;
308307 $ item = $ this ->dbi ->fetchSingleRow ($ query );
309308 if (! $ item ) {
@@ -414,21 +413,15 @@ public function getQueryFromRequest(): string
414413 }
415414
416415 if (! empty ($ _POST ['item_starts ' ])) {
417- $ query .= "STARTS ' "
418- . $ this ->dbi ->escapeString ($ _POST ['item_starts ' ])
419- . "' " ;
416+ $ query .= 'STARTS ' . $ this ->dbi ->quoteString ($ _POST ['item_starts ' ]) . ' ' ;
420417 }
421418
422419 if (! empty ($ _POST ['item_ends ' ])) {
423- $ query .= "ENDS ' "
424- . $ this ->dbi ->escapeString ($ _POST ['item_ends ' ])
425- . "' " ;
420+ $ query .= 'ENDS ' . $ this ->dbi ->quoteString ($ _POST ['item_ends ' ]) . ' ' ;
426421 }
427422 } else {
428423 if (! empty ($ _POST ['item_execute_at ' ])) {
429- $ query .= "AT ' "
430- . $ this ->dbi ->escapeString ($ _POST ['item_execute_at ' ])
431- . "' " ;
424+ $ query .= 'AT ' . $ this ->dbi ->quoteString ($ _POST ['item_execute_at ' ]) . ' ' ;
432425 } else {
433426 $ GLOBALS ['errors ' ][] = __ ('You must provide a valid execution time for the event. ' );
434427 }
@@ -453,7 +446,7 @@ public function getQueryFromRequest(): string
453446 }
454447
455448 if (! empty ($ _POST ['item_comment ' ])) {
456- $ query .= " COMMENT ' " . $ this ->dbi ->escapeString ($ _POST ['item_comment ' ]) . " ' " ;
449+ $ query .= ' COMMENT ' . $ this ->dbi ->quoteString ($ _POST ['item_comment ' ]) . ' ' ;
457450 }
458451
459452 $ query .= 'DO ' ;
@@ -599,13 +592,13 @@ public function getDetails(string $db, string $name = ''): array
599592 {
600593 if (! $ GLOBALS ['cfg ' ]['Server ' ]['DisableIS ' ]) {
601594 $ query = QueryGenerator::getInformationSchemaEventsRequest (
602- $ this ->dbi ->escapeString ($ db ),
603- $ name === '' ? null : $ this ->dbi ->escapeString ($ name ),
595+ $ this ->dbi ->quoteString ($ db ),
596+ $ name === '' ? null : $ this ->dbi ->quoteString ($ name ),
604597 );
605598 } else {
606599 $ query = 'SHOW EVENTS FROM ' . Util::backquote ($ db );
607600 if ($ name !== '' ) {
608- $ query .= " WHERE `Name` = ' " . $ this ->dbi ->escapeString ($ name ) . " ' " ;
601+ $ query .= ' WHERE `Name` = ' . $ this ->dbi ->quoteString ($ name );
609602 }
610603 }
611604
0 commit comments