ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
UpdateSteps.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
28{
29 public function prepare(ilDBInterface $db): void
30 {
31 $this->db = $db;
32 }
33
34 public function step_1(): void
35 {
36 $replace = [
37 '&lt;' => '<',
38 '&gt;' => '>',
39 '&amp;' => '&',
40 '&quot;' => '"',
41 ];
42
43 $replaced_message = 'message';
44 foreach ($replace as $from => $to) {
45 $replaced_message = sprintf(
46 'REPLACE(%s, %s, %s)',
47 $replaced_message,
48 $this->db->quote($from, ilDBConstants::T_TEXT),
49 $this->db->quote($to, ilDBConstants::T_TEXT)
50 );
51 }
52
53 $this->db->manipulate('UPDATE osc_messages SET message = ' . $replaced_message);
54 }
55}
Class ilDBConstants.
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...