Branch110

Le 05/08/2014 19:06, Richard Griffith a écrit :
>
> In htdocs/xoops_lib/Xoops/Core/Kernel/Model/Write.php:
>
> > @@ -44,17 +44,7 @@ class Write extends XoopsModelAbstract
> >       */
> >      public function cleanVars(XoopsObject &$object)
> >      {
> > -        $vars = $object->getVars();
> > -        $object->cleanVars = array();
> > -        foreach ($vars as $k => $v) {
> > -            if (!$v["changed"]) {
> > -                continue;
> > -            }
> > -            $object->cleanVars[$k] = Dtype::cleanVar($object, $k, false);
> > -        }
> > -        $object->unsetDirty();
> > -        $errors = $object->getErrors();
> > -        return empty($errors) ? true : false;
> > +        return $object->cleanVars();
>
> This change results in all strings being wrapped with single quotes 
> causing many problems. This change was reverted with PR #176 
> <https://github.com/XOOPS/XoopsCore/pull/176>
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/XOOPS/XoopsCore/pull/174/files#r15826238>.
>


Richard,

I was looking to use the existing code in XoopsObject. As You could see 
there already is a cleanVar method in XoopsObject which do the same thing.

The error in my patch was to let the default $quote parameter to true 
and not setting it to false to avoid the problem you raised.

For me, to avoid duplicate content and ensure that same function do the 
same thing, we have to modify write.php as follow :
     public function cleanVars(XoopsObject &$object)
     {
         return $object->cleanVars(FALSE);
     }