From: <du...@us...> - 2012-12-06 14:57:09
|
Revision: 10327 http://sourceforge.net/p/xoops/svn/10327 Author: dugris Date: 2012-12-06 14:57:05 +0000 (Thu, 06 Dec 2012) Log Message: ----------- fix : insert, updata tplfile, tplsource remove quoteString (insert/update) Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php 2012-12-06 04:04:15 UTC (rev 10326) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php 2012-12-06 14:57:05 UTC (rev 10327) @@ -255,7 +255,7 @@ } if ($tplfile->isNew()) { $tpl_id = $this->db->genId('tpltpl_file_id_seq'); - $sql = sprintf("INSERT INTO %s (tpl_id, tpl_module, tpl_refid, tpl_tplset, tpl_file, tpl_desc, tpl_lastmodified, tpl_lastimported, tpl_type) VALUES (%u, %s, %u, %s, %s, %s, %u, %u, %s)", $this->db->prefix('tplfile'), $tpl_id, $this->db->quoteString($tpl_module), $tpl_refid, $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastmodified, $tpl_lastimported, $this->db->quoteString($tpl_type)); + $sql = sprintf("INSERT INTO %s (tpl_id, tpl_module, tpl_refid, tpl_tplset, tpl_file, tpl_desc, tpl_lastmodified, tpl_lastimported, tpl_type) VALUES (%u, %s, %u, %s, %s, %s, %u, %u, %s)", $this->db->prefix('tplfile'), $tpl_id, $tpl_module, $tpl_refid, $tpl_tplset, $tpl_file, $tpl_desc, $tpl_lastmodified, $tpl_lastimported, $tpl_type); if (!$this->db->query($sql)) { return false; } @@ -263,7 +263,7 @@ $tpl_id = $this->db->getInsertId(); } if (isset($tpl_source) && $tpl_source != '') { - $sql = sprintf("INSERT INTO %s (tpl_id, tpl_source) VALUES (%u, %s)", $this->db->prefix('tplsource'), $tpl_id, $this->db->quoteString($tpl_source)); + $sql = sprintf("INSERT INTO %s (tpl_id, tpl_source) VALUES (%u, %s)", $this->db->prefix('tplsource'), $tpl_id, $tpl_source); if (!$this->db->query($sql)) { $this->db->query(sprintf("DELETE FROM %s WHERE tpl_id = %u", $this->db->prefix('tplfile'), $tpl_id)); return false; @@ -271,12 +271,12 @@ } $tplfile->assignVar('tpl_id', $tpl_id); } else { - $sql = sprintf("UPDATE %s SET tpl_tplset = %s, tpl_file = %s, tpl_desc = %s, tpl_lastimported = %u, tpl_lastmodified = %u WHERE tpl_id = %u", $this->db->prefix('tplfile'), $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastimported, $tpl_lastmodified, $tpl_id); + $sql = sprintf("UPDATE %s SET tpl_tplset = %s, tpl_file = %s, tpl_desc = %s, tpl_lastimported = %u, tpl_lastmodified = %u WHERE tpl_id = %u", $this->db->prefix('tplfile'), $tpl_tplset, $tpl_file, $tpl_desc, $tpl_lastimported, $tpl_lastmodified, $tpl_id); if (!$this->db->query($sql)) { return false; } if (isset($tpl_source) && $tpl_source != '') { - $sql = sprintf("UPDATE %s SET tpl_source = %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $this->db->quoteString($tpl_source), $tpl_id); + $sql = sprintf("UPDATE %s SET tpl_source = %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $tpl_source, $tpl_id); if (!$this->db->query($sql)) { return false; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php 2012-12-06 04:04:15 UTC (rev 10326) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php 2012-12-06 14:57:05 UTC (rev 10327) @@ -831,6 +831,7 @@ $tplfile_new->setVar('tpl_type', 'block'); } else { $tplfile_new = $tplfile[0]; + $tplfile_new->setVars($tplfile_new->toArray()); } $tplfile_new->setVar('tpl_source', $content, true); $tplfile_new->setVar('tpl_desc', $block['description'], true); |