1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Major model issue leading to double html encoded DB data solved

This commit is contained in:
secretr
2010-02-12 16:42:28 +00:00
parent 757e02924c
commit 560364ec39

View File

@@ -1269,6 +1269,8 @@ class e_admin_model extends e_model
$posted = $this->getPostedData((string) $key, null, $index); $posted = $this->getPostedData((string) $key, null, $index);
if(null !== $posted) if(null !== $posted)
{ {
// FIXED - double post_toFom() and toDB(post_toForm()) problems
// setPosted|setPostedData|addPostedData methods are storing RAW data now
return e107::getParser()->post_toForm($posted); return e107::getParser()->post_toForm($posted);
} }
return e107::getParser()->toForm($this->getData((string) $key, $default, $index)); return e107::getParser()->toForm($this->getData((string) $key, $default, $index));
@@ -1283,17 +1285,10 @@ class e_admin_model extends e_model
* @param string $key * @param string $key
* @param mixed $value * @param mixed $value
* @param boolean $strict update only * @param boolean $strict update only
* @param boolean $toForm use post_toForm() on both key and data arguments
* @return e_admin_model * @return e_admin_model
*/ */
public function setPosted($key, $value, $strict = false, $toForm = true) public function setPosted($key, $value, $strict = false)
{ {
if($toForm)
{
$tp = e107::getParser();
$key = $tp->post_toForm($key);
$value = $tp->post_toForm($value);
}
return $this->_setDataSimple($key, $value, $strict, '_posted_data'); return $this->_setDataSimple($key, $value, $strict, '_posted_data');
} }
@@ -1306,17 +1301,10 @@ class e_admin_model extends e_model
* @param string|array $key * @param string|array $key
* @param mixed $value * @param mixed $value
* @param boolean $strict update only * @param boolean $strict update only
* @param boolean $toForm use post_toForm() on both key and data arguments
* @return e_admin_model * @return e_admin_model
*/ */
public function setPostedData($key, $value = null, $strict = false, $toForm = true) public function setPostedData($key, $value = null, $strict = false)
{ {
if($toForm)
{
$tp = e107::getParser();
$key = $tp->post_toForm($key);
$value = $tp->post_toForm($value);
}
return $this->_setData($key, $value, $strict, '_posted_data'); return $this->_setData($key, $value, $strict, '_posted_data');
} }
@@ -1330,17 +1318,10 @@ class e_admin_model extends e_model
* @param string|array $key * @param string|array $key
* @param mixed $value * @param mixed $value
* @param boolean $override override existing data * @param boolean $override override existing data
* @param boolean $toForm use post_toForm() on both key and data arguments
* @return e_admin_model * @return e_admin_model
*/ */
public function addPostedData($key, $value = null, $override = true, $toForm = true) public function addPostedData($key, $value = null, $override = true)
{ {
if($toForm)
{
$tp = e107::getParser();
$key = $tp->post_toForm($key);
$value = $tp->post_toForm($value);
}
return $this->_addData($key, $value, $override, '_posted_data'); return $this->_addData($key, $value, $override, '_posted_data');
} }
@@ -1476,8 +1457,7 @@ class e_admin_model extends e_model
} }
else //no db field types, use toDB() else //no db field types, use toDB()
{ {
$tp = e107::getParser(); $data = e107::getParser()->toDB($data);
$data = $tp->toDB($data);
} }
} }