Example #1
0
         while ($row = $db->fetch_object($faqComments)) {
             switch ($DB["type"]) {
                 default:
                     $query[] = "UPDATE " . SQLPREFIX . "faqcomments SET " . "      usr = '******'" . ", comment = '" . $db->escape_string(fixslashes($row->comment)) . "'" . " WHERE id_comment = '" . $row->id_comment . "'";
                     break;
             }
         }
     }
     // Table: faqfragen
     $faqQuestionsQuery = "SELECT * FROM " . SQLPREFIX . "faqfragen" . " WHERE ask_username LIKE '%\\\\\\\\%'" . "     OR ask_content LIKE '%\\\\\\\\%'";
     $faqQuestions = $db->query($faqQuestionsQuery);
     if ($db->num_rows($faqQuestions) > 0) {
         while ($row = $db->fetch_object($faqQuestions)) {
             switch ($DB["type"]) {
                 default:
                     $query[] = "UPDATE " . SQLPREFIX . "faqfragen SET " . " ask_username = '******'" . ", ask_content = '" . $db->escape_string(fixslashes($row->ask_content)) . "'" . " WHERE id = '" . $row->id . "'";
                     break;
             }
         }
     }
 }
 // update from versions before 1.6.0
 if ($version < 160) {
     $query[] = 'ALTER TABLE ' . SQLPREFIX . 'faqdata ADD solution_id INTEGER NOT NULL AFTER lang';
     $query[] = 'ALTER TABLE ' . SQLPREFIX . 'faqdata ADD revision_id INTEGER NOT NULL AFTER solution_id';
     $query[] = 'ALTER TABLE ' . SQLPREFIX . 'faqchanges ADD revision_id INTEGER NOT NULL AFTER lang';
     switch ($DB["type"]) {
         case 'mysql':
         case 'mysqli':
         case 'sqlite':
             $query[] = "CREATE TABLE " . SQLPREFIX . "faqdata_revisions (id int(11) NOT NULL, lang varchar(5) NOT NULL, solution_id int(11) NOT NULL, revision_id int(11) NOT NULL DEFAULT 0, active char(3) NOT NULL, keywords text NOT NULL, thema text NOT NULL, content longtext NOT NULL, author varchar(255) NOT NULL, email varchar(255) NOT NULL, comment char(1) NOT NULL, datum varchar(15) NOT NULL, PRIMARY KEY (id, lang, solution_id, revision_id))";
Example #2
0
 function fixslashes($unc)
 {
     $unc = str_replace("\\", "/", $unc);
     $unc = str_replace("//", "/", $unc);
     $check = strpos($unc, "//");
     if ($check == false) {
         return $unc;
     } else {
         fixslashes($unc);
     }
 }