Commit e09e39e736bd2f00f5effd0de754e2976eccfb74

Authored by Conrad Vermeulen
1 parent 614cbd3d

KTS-2737

"Folder util sanitises too much which results in additional slashes being added to the database"
Updated.

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7764 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/foldermanagement/Folder.inc
@@ -7,32 +7,32 @@ @@ -7,32 +7,32 @@
7 * KnowledgeTree Open Source Edition 7 * KnowledgeTree Open Source Edition
8 * Document Management Made Simple 8 * Document Management Made Simple
9 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited 9 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
10 - * 10 + *
11 * This program is free software; you can redistribute it and/or modify it under 11 * This program is free software; you can redistribute it and/or modify it under
12 * the terms of the GNU General Public License version 3 as published by the 12 * the terms of the GNU General Public License version 3 as published by the
13 * Free Software Foundation. 13 * Free Software Foundation.
14 - * 14 + *
15 * This program is distributed in the hope that it will be useful, but WITHOUT 15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * details. 18 * details.
19 - * 19 + *
20 * You should have received a copy of the GNU General Public License 20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. 21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 - * 22 + *
23 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, 23 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
24 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. 24 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
25 - * 25 + *
26 * The interactive user interfaces in modified source and object code versions 26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under 27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU General Public License version 3. 28 * Section 5 of the GNU General Public License version 3.
29 - * 29 + *
30 * In accordance with Section 7(b) of the GNU General Public License version 3, 30 * In accordance with Section 7(b) of the GNU General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by 31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 32 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
34 - * must display the words "Powered by KnowledgeTree" and retain the original  
35 - * copyright notice. 34 + * must display the words "Powered by KnowledgeTree" and retain the original
  35 + * copyright notice.
36 * Contributor( s): ______________________________________ 36 * Contributor( s): ______________________________________
37 */ 37 */
38 38
@@ -82,10 +82,10 @@ class Folder extends KTEntity { @@ -82,10 +82,10 @@ class Folder extends KTEntity {
82 // }}} 82 // }}}
83 83
84 function getID() { return $this->iId; } 84 function getID() { return $this->iId; }
85 - function getName() { return sanitizeForSQLtoHTML($this->sName); }  
86 - function setName($sNewValue) { $this->sName = sanitizeForSQL($sNewValue); }  
87 - function getDescription() { return sanitizeForSQLtoHTML($this->sDescription); }  
88 - function setDescription($sNewValue) { $this->sDescription = sanitizeForSQL($sNewValue); } 85 + function getName() { return ($this->sName); }
  86 + function setName($sNewValue) { $this->sName = ($sNewValue); }
  87 + function getDescription() { return ($this->sDescription); }
  88 + function setDescription($sNewValue) { $this->sDescription = ($sNewValue); }
89 function getParentID() { return $this->iParentID; } 89 function getParentID() { return $this->iParentID; }
90 function setParentID($iNewValue) { $this->iParentID = $iNewValue; } 90 function setParentID($iNewValue) { $this->iParentID = $iNewValue; }
91 function getCreatorID() { return $this->iCreatorID; } 91 function getCreatorID() { return $this->iCreatorID; }
lib/foldermanagement/folderutil.inc.php
@@ -57,8 +57,8 @@ class KTFolderUtil { @@ -57,8 +57,8 @@ class KTFolderUtil {
57 } 57 }
58 $oStorage =& KTStorageManagerUtil::getSingleton(); 58 $oStorage =& KTStorageManagerUtil::getSingleton();
59 $oFolder =& Folder::createFromArray(array( 59 $oFolder =& Folder::createFromArray(array(
60 - 'name' => sanitizeForSQL($sFolderName),  
61 - 'description' => sanitizeForSQL($sFolderName), 60 + 'name' => ($sFolderName),
  61 + 'description' => ($sFolderName),
62 'parentid' => $oParentFolder->getID(), 62 'parentid' => $oParentFolder->getID(),
63 'creatorid' => $oUser->getID(), 63 'creatorid' => $oUser->getID(),
64 )); 64 ));