AntonLV 5 ani în urmă
părinte
comite
cd39d37d17

+ 2 - 2
inc/classes/BxDolTemplate.php

@@ -2450,7 +2450,7 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
                 continue;
 
             $aKeys[] = "'" . $aKeyWrappers['left'] . $aKeysSrc[$i] . $aKeyWrappers['right'] . "'s";
-            $aValues[] = str_replace('$', '\\$', $aValuesSrc[$i]);
+            $aValues[] = str_replace('$', '\\$', str_replace('\\', '\\\\', $aValuesSrc[$i]));
         }
 
         //--- Parse keys with constructions ---//
@@ -2485,7 +2485,7 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
                 continue;
 
             $aKeys[] = $sKey;
-            $aValues[] = str_replace('$', '\\$', $sValue);
+            $aValues[] = str_replace('$', '\\$', str_replace('\\', '\\\\', $sValue));
         }
 
         try {

+ 1 - 4
modules/boonex/developer/classes/BxDevDb.php

@@ -29,15 +29,12 @@ class BxDevDb extends BxDolModuleDb
             $aValues = array_values($aItem);
             $iValues = count($aValues);
 
-            foreach ($aValues as $iKey => $sValue)
-                $aValues[$iKey] = BxDevFunctions::dbAddSlashes($sValue, true);
-
             if($bFirst) {
                 $sContent .= "INSERT INTO `" . $sTable . "`(`" . implode("`, `", $aKeys) . "`) VALUES \n";
                 $bFirst = false;
             }
 
-            $sSql = "(" . implode(", ", array_fill(0, $iValues, "?")) . "),\n";
+            $sSql = "(" . implode(", ", array_fill(0, $iValues, "?")) . "),\n";            
             $sSql = call_user_func_array(array($this, 'prepareAsString'), array_merge(array($sSql), $aValues));
 
             $sContent .= $sSql;

+ 1 - 0
modules/boonex/developer/classes/BxDevFormsForms.php

@@ -160,6 +160,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
                     'name' => 'insert',
                     'caption' => _t('_bx_dev_frm_txt_forms_export_insert'),
                     'value' => $sContentInsert,
+                    'code' => 1
                 ),
                 'delete' => array(
                     'type' => 'textarea',

+ 1 - 1
modules/boonex/developer/classes/BxDevFormsPreLists.php

@@ -120,7 +120,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
 
         $aValues = array();
         $this->oDb->getValues(array('type' => 'by_key', 'value' => $aList['key']), $aValues, false);
-        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_form_pre_values', $aValues, false, array('id', 'key', 'value', 'lkey', 'lkey2', 'order'));
+        $sContentInsert .= $this->oModule->_oDb->getQueryInsert('sys_form_pre_values', $aValues, false, array('id', 'key', 'value', 'lkey', 'lkey2', 'data', 'order'));
         $sContentDelete .= $this->oModule->_oDb->getQueryDelete('sys_form_pre_values', 'Key', array(array('Key' => $aList['key'])), false);
 
         $aFormStructure = array(

+ 0 - 17
modules/boonex/developer/classes/BxDevFunctions.php

@@ -105,23 +105,6 @@ class BxDevFunctions
 
         return var_export($aValue, true);
     }
-
-    /**
-     * Add slashes before "'" and "\" characters that the value containing them can be used in export feature.
-     *
-     * @param  string  $sString       - the input string to add slashes
-     * @param  boolean $bDoubleEscape - whether the string needs to be two more escaped or not
-     * @return string  the slashed string
-     */
-    public static function dbAddSlashes($sString = '', $bDoubleEscape = false)
-    {
-        if ($bDoubleEscape)
-            $sString = str_replace('\\', '\\\\\\\\', $sString);
-        else
-            $sString = str_replace('\\', '\\\\', $sString);
-
-        return str_replace('\'', '\\\'', $sString);
-    }
 }
 
 /** @} */