From e4325eb03afea5fcd560fe832b82207a490df359 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Sun, 6 Nov 2005 11:33:28 +0000
Subject: [PATCH] - Patch #22215 by Richard Archer: fixed glitch in the upgrade
 path for primary/secondary links.

---
 database/updates.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/database/updates.inc b/database/updates.inc
index f7ea330414ac..5f6aaef9408e 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -1071,7 +1071,9 @@ function update_151() {
 
           $mid = db_next_id('{menu}_mid');
           $ret[] = update_sql("INSERT INTO {menu} (mid, pid, path, title, description, weight, type) " .
-                               "VALUES ($mid, {$menus[$loop]['pid']}, '$link_path', '{$links['text'][$i]}', '{$links['description'][$i]}', 0, 118)");
+                               "VALUES ($mid, {$menus[$loop]['pid']}, '" . db_escape_string($link_path) .
+                               "', '" . db_escape_string($links['text'][$i]) .
+                               "', '" . db_escape_string($links['description'][$i]) . "', 0, 118)");
         }
       }
       // delete Secondary links if not populated.
-- 
GitLab