Skip to content

Commit c50b73d

Browse files
committed
Fix raw SQL
1 parent 21b00b6 commit c50b73d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

inc/profile.class.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,14 @@ public static function initProfile()
177177
{
178178
global $DB;
179179

180-
foreach ($DB->request("SELECT *
181-
FROM `glpi_profilerights`
182-
WHERE `profiles_id`='".$_SESSION['glpiactiveprofile']['id']."'
183-
AND `name` LIKE '%plugin_addressing%'") as $prof) {
180+
$it = $DB->request([
181+
'FROM' => 'glpi_profilerights',
182+
'WHERE' => [
183+
'profiles_id' => $_SESSION['glpiactiveprofile']['id'],
184+
'name' => ['LIKE', '%plugin_addressing%']
185+
]
186+
]);
187+
foreach ($it as $prof) {
184188
if (isset($_SESSION['glpiactiveprofile'])) {
185189
$_SESSION['glpiactiveprofile'][$prof['name']] = $prof['rights'];
186190
}

0 commit comments

Comments
 (0)