From e97d4606086659f995b4ec3bf5ea86eb8039eb64 Mon Sep 17 00:00:00 2001 From: "M@d D3n" Date: Fri, 10 Jul 2020 12:01:40 +0300 Subject: [PATCH] Fixes --- fields/code/tpl/field.tpl | 2 +- fields/image_multi/field.php | 10 ++++++---- fields/image_single/field.php | 22 ++++------------------ functions/func.documents.php | 2 +- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/fields/code/tpl/field.tpl b/fields/code/tpl/field.tpl index 0b99b0b..9da4802 100644 --- a/fields/code/tpl/field.tpl +++ b/fields/code/tpl/field.tpl @@ -5,4 +5,4 @@ {/if} -{include file="$codemirror_editor" conn_id=$f_id textarea_id="field_code_$f_id" ctrls='SaveAjax();' height=300} \ No newline at end of file +{include file="$codemirror_editor" conn_id=$f_id textarea_id="field_code_$f_id" ctrls='AveDocs.documentSaveFunction();' height=300} \ No newline at end of file diff --git a/fields/image_multi/field.php b/fields/image_multi/field.php index 0d44a6b..c32e933 100755 --- a/fields/image_multi/field.php +++ b/fields/image_multi/field.php @@ -309,10 +309,12 @@ : ''; } - function getExtension($file) - { - $file = pathinfo($file); - return $file['extension']; + if (! function_exists('getExtension')) { + function getExtension($file) + { + $file = pathinfo($file); + return $file['extension']; + } } $valid_formats = array("jpg", "png", "gif", "bmp","jpeg"); diff --git a/fields/image_single/field.php b/fields/image_single/field.php index 5a50e13..d2cb039 100644 --- a/fields/image_single/field.php +++ b/fields/image_single/field.php @@ -64,21 +64,14 @@ { $field_value = preg_replace_callback( '/\[tag:parametr:(\d+)\]/i', - function($data) use($field_param) + function($data) use ($field_param) { return $field_param[(int)$data[1]]; }, $tpl ); - $field_value = preg_replace_callback( - '/\[tag:watermark:(.+?):([a-zA-Z]+):([0-9]+)\]/', - create_function( - '$m', - 'return watermarks(\'$m[1]\', \'$m[2]\', $m[3]);' - ), - $field_value - ); + $field_value = preg_replace_callback('/\[tag:watermark:(.+?):([a-zA-Z]+):([0-9]+)\]/', 'watermarks', $field_value); $field_value = preg_replace_callback('/\[tag:([r|c|f|t|s]\d+x\d+r*):(.+?)]/', 'callback_make_thumbnail', $field_value); } @@ -108,21 +101,14 @@ { $field_value = preg_replace_callback( '/\[tag:parametr:(\d+)\]/i', - function($data) use($field_param) + function($data) use ($field_param) { return $field_param[(int)$data[1]]; }, $tpl ); - $field_value = preg_replace_callback( - '/\[tag:watermark:(.+?):([a-zA-Z]+):([0-9]+)\]/', - create_function( - '$m', - 'return watermarks(\'$m[1]\', \'$m[2]\', $m[3]);' - ), - $field_value - ); + $field_value = preg_replace_callback('/\[tag:watermark:(.+?):([a-zA-Z]+):([0-9]+)\]/', 'watermarks', $field_value); $field_value = preg_replace_callback('/\[tag:([r|c|f|t|s]\d+x\d+r*):(.+?)]/', 'callback_make_thumbnail', $field_value); } diff --git a/functions/func.documents.php b/functions/func.documents.php index 5a32135..824e991 100644 --- a/functions/func.documents.php +++ b/functions/func.documents.php @@ -99,7 +99,7 @@ $get_documents_data[$doc_id] = object2array($get_documents_data[$doc_id]); - $get_documents_data[$doc_id]['doc_title'] = $get_documents_data[$doc_id]['document_title']; + $get_documents_data[$doc_id]['doc_title'] = $get_documents_data[$doc_id]['document_title'] = htmlspecialchars_decode($get_documents_data[$doc_id]['document_title'], ENT_QUOTES); $get_documents_data[$doc_id]['feld'] = []; }