From 21b617e722a8b6612bd265c3fbb5779ca76652ce Mon Sep 17 00:00:00 2001 From: Repellent Date: Sun, 21 Sep 2025 19:01:51 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B0=D0=BD=D0=BE=D0=BD?= =?UTF-8?q?=D0=B8=D0=BC=D0=BD=D0=BE=D0=B9=20=D1=84=D1=83=D0=BD=D0=BA=D1=86?= =?UTF-8?q?=D0=B8=D0=B8:=20=D0=92=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20create?= =?UTF-8?q?=5Ffunction=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83?= =?UTF-8?q?=D0=B5=D1=82=D1=81=D1=8F=20=D0=B0=D0=BD=D0=BE=D0=BD=D0=B8=D0=BC?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F?= =?UTF-8?q?,=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D0=B0=D1=8F=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=B8=D0=BC=D0=B0=D0=B5=D1=82=20$matches=20=D0=B8?= =?UTF-8?q?=20=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89=D0=B0=D0=B5=D1=82?= =?UTF-8?q?=20=D0=BD=D1=83=D0=B6=D0=BD=D0=BE=D0=B5=20=D0=B7=D0=BD=D0=B0?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D0=B5.=20=D0=9F=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=BA=D0=B0=20=D1=81=D1=83=D1=89=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F:=20=D0=98=D1=81?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D1=82=D1=81=D1=8F=20?= =?UTF-8?q?=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=20"=3F=3F",=20?= =?UTF-8?q?=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=B8=D0=B7=D0=B1=D0=B5=D0=B6?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA,=20?= =?UTF-8?q?=D0=B5=D1=81=D0=BB=D0=B8=20=D0=BA=D0=BB=D1=8E=D1=87=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D1=81=D1=83=D1=89=D0=B5=D1=81=D1=82=D0=B2=D1=83=D0=B5?= =?UTF-8?q?=D1=82=20=D0=B2=20=D0=BC=D0=B0=D1=81=D1=81=D0=B8=D0=B2=D0=B5=20?= =?UTF-8?q?$=5FREQUEST["demo=5Fchange"].=20=D0=92=20=D1=8D=D1=82=D0=BE?= =?UTF-8?q?=D0=BC=20=D1=81=D0=BB=D1=83=D1=87=D0=B0=D0=B5=20=D0=B1=D1=83?= =?UTF-8?q?=D0=B4=D0=B5=D1=82=20=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=83=D1=81=D1=82=D0=B0=D1=8F=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- forms/class/forms.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/forms/class/forms.php b/forms/class/forms.php index f29267e..7089497 100644 --- a/forms/class/forms.php +++ b/forms/class/forms.php @@ -793,7 +793,7 @@ // для правильного вывода селектов if (empty($form['mail_set']['receivers'])) $form['mail_set']['receivers'] = array(0 => array()); - + // Добавляем проверку, чтобы избежать ошибки if (is_array($form['fields'])) { @@ -936,7 +936,14 @@ // обновляем форму с данными примера $this->form_save($fid); // подставляем в шаблон новые id полей - $demo['form_tpl'] = preg_replace_callback('/\[tag:fld:(\d+)]/', create_function('$matches','return "[tag:fld:" . $_REQUEST["demo_change"][(int)$matches[1]] . "]";'),$demo['form_tpl']); + $demo['form_tpl'] = preg_replace_callback( + '/\[tag:fld:(\d+)]/', + function($matches) { + return "[tag:fld:" . ($_REQUEST["demo_change"][(int)$matches[1]] ?? '') . "]"; + }, + $demo['form_tpl'] + ); + $AVE_DB->Query(" UPDATE " . PREFIX . "_module_forms_forms SET