From aba13ac4cf25fd29a8c5e8a3ff3f3a3fbc5af582 Mon Sep 17 00:00:00 2001 From: prasad <prasad@vtiger.com> Date: Fri, 17 May 2024 12:16:17 +0530 Subject: [PATCH] E_ALL - fixes for Documents Module --- data/CRMEntity.php | 2 +- include/QueryGenerator/EnhancedQueryGenerator.php | 2 +- include/utils/ListViewUtils.php | 3 +++ include/utils/VtlibUtils.php | 1 + include/utils/utils.php | 7 ++++--- includes/runtime/Viewer.php | 4 ++-- layouts/v7/modules/Documents/CreateDocument.tpl | 4 ++-- layouts/v7/modules/Documents/ModuleHeader.tpl | 2 +- layouts/v7/modules/Documents/UploadDocument.tpl | 4 ++-- .../v7/modules/Documents/partials/SidebarEssentials.tpl | 2 +- layouts/v7/modules/Vtiger/ListViewActions.tpl | 4 ++-- layouts/v7/modules/Vtiger/ListViewContents.tpl | 4 ++++ layouts/v7/modules/Vtiger/uitypes/String.tpl | 2 +- layouts/v7/modules/Vtiger/uitypes/Text.tpl | 2 +- modules/Documents/Documents.php | 8 +++++--- modules/Documents/models/Record.php | 3 ++- modules/Documents/views/List.php | 8 ++++---- modules/Documents/views/QuickCreateAjax.php | 4 ++-- modules/Vtiger/helpers/Util.php | 2 +- modules/Vtiger/models/Field.php | 2 +- vtlib/Vtiger/Functions.php | 7 +++++++ 21 files changed, 48 insertions(+), 29 deletions(-) diff --git a/data/CRMEntity.php b/data/CRMEntity.php index 70feb2784..5e7569897 100644 --- a/data/CRMEntity.php +++ b/data/CRMEntity.php @@ -159,7 +159,7 @@ class CRMEntity { */ function uploadAndSaveFile($id, $module, $file_details, $attachmentType='Attachment') { global $log; - $log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method."); + $log->debug("Entering into uploadAndSaveFile($id,$module) method."); global $adb, $current_user; global $upload_badext; diff --git a/include/QueryGenerator/EnhancedQueryGenerator.php b/include/QueryGenerator/EnhancedQueryGenerator.php index d842693a3..74ef79dba 100644 --- a/include/QueryGenerator/EnhancedQueryGenerator.php +++ b/include/QueryGenerator/EnhancedQueryGenerator.php @@ -578,7 +578,7 @@ class EnhancedQueryGenerator extends QueryGenerator { foreach ($tableJoinCondition as $fieldName => $conditionInfo) { foreach ($conditionInfo as $tableName => $condition) { - if ($tableList[$tableName]) { + if (isset($tableList[$tableName])) { $tableNameAlias = $tableName.'2'; $condition = str_replace($tableName, $tableNameAlias, $condition); } else { diff --git a/include/utils/ListViewUtils.php b/include/utils/ListViewUtils.php index 3fb50b958..941000590 100755 --- a/include/utils/ListViewUtils.php +++ b/include/utils/ListViewUtils.php @@ -674,6 +674,9 @@ function decode_emptyspace_html($str){ } function decode_html($str) { + // null or blank + if (!$str) return $str; + global $default_charset; // Direct Popup action or Ajax Popup action should be treated the same. if ((isset($_REQUEST['action']) && $_REQUEST['action'] == 'Popup') || (isset($_REQUEST['file']) && $_REQUEST['file'] == 'Popup')) diff --git a/include/utils/VtlibUtils.php b/include/utils/VtlibUtils.php index 06e20bfd7..24352abb1 100644 --- a/include/utils/VtlibUtils.php +++ b/include/utils/VtlibUtils.php @@ -815,6 +815,7 @@ function strcasecmp_accents_callback() { * @return <String> */ function purifyHtmlEventAttributes($value,$replaceAll = false){ + if (!$value) return $value; $tmp_markers = $office365ImageMarkers = array(); $value = Vtiger_Functions::strip_base64_data($value,true,$tmp_markers); diff --git a/include/utils/utils.php b/include/utils/utils.php index c7e28588e..ca897998b 100755 --- a/include/utils/utils.php +++ b/include/utils/utils.php @@ -2439,13 +2439,14 @@ function getRecordGroupId($record) { * Function to delete record from $_SESSION[$moduleName.'_DetailView_Navigation'.$cvId] */ function deleteRecordFromDetailViewNavigationRecords($recordId, $cvId, $moduleName) { - $recordNavigationInfo = Zend_Json::decode($_SESSION[$moduleName . '_DetailView_Navigation' . $cvId]); - if (!empty($recordNavigationInfo) && (php7_count($recordNavigationInfo) != 0)) { + $cachekey = ($moduleName . '_DetailView_Navigation' . $cvId); + $recordNavigationInfo = isset($_SESSION[$cachekey]) ? Zend_Json::decode($_SESSION[$cachekey]) : null; + if ($recordNavigationInfo && (php7_count($recordNavigationInfo) != 0)) { foreach ($recordNavigationInfo as $key => $recordIdList) { $recordIdList = array_diff($recordIdList, array($recordId)); $recordNavigationInfo[$key] = $recordIdList; } - $_SESSION[$moduleName . '_DetailView_Navigation' . $cvId] = Zend_Json::encode($recordNavigationInfo); + $_SESSION[$cachekey] = Zend_Json::encode($recordNavigationInfo); } } diff --git a/includes/runtime/Viewer.php b/includes/runtime/Viewer.php index 023499373..da4837c96 100644 --- a/includes/runtime/Viewer.php +++ b/includes/runtime/Viewer.php @@ -75,7 +75,7 @@ class Vtiger_Viewer extends Smarty { $classes = array('Vtiger_MenuStructure_Model', 'Users_Privileges_Model', 'Vtiger_Module_Model', 'Settings_MenuEditor_Module_Model', 'Vtiger_Util_Helper', 'ZEND_JSON', 'Zend_Json', 'Zend_JSON', 'ZEND_json', - 'Vtiger_Theme', 'Users_Record_Model', 'Vtiger_Module_Model', 'Vtiger_Field_Model', + 'Vtiger_Theme', 'Users_Record_Model', 'Vtiger_Module_Model', 'Vtiger_Field_Model', 'Vtiger_Record_Model', 'Settings_Picklist_Module_Model', 'CustomView_Record_Model', 'Vtiger_Extension_View', 'Vtiger_Tag_Model', 'Settings_Vtiger_Module_Model', 'PBXManager_Server_Model', 'Vtiger_Functions', 'Users', 'CurrencyField'); @@ -87,7 +87,7 @@ class Vtiger_Viewer extends Smarty { $modifiers = array('vtranslate', 'vtlib_isModuleActive', 'vimage_path', 'strstr', 'stripos', 'strpos', 'date', 'vtemplate_path', 'vresource_url', 'decode_html', 'vtlib_purify', 'php7_count', 'getUserFullName', 'array_flip', 'explode', 'trim', 'array_push', - 'array_map', 'array_key_exists', 'get_class', 'vtlib_array', 'getDuplicatesPreventionMessage', 'htmlentities', + 'array_map', 'array_key_exists', 'get_class', 'vtlib_array', 'getDuplicatesPreventionMessage', 'htmlentities', 'purifyHtmlEventAttributes', 'getCurrencySymbolandCRate', 'mb_substr', 'isPermitted', 'getEntityName', 'function_exists', 'php7_trim', 'php7_htmlentities', 'strtolower', 'strtoupper', 'str_replace', 'urlencode', 'getTranslatedCurrencyString', 'getTranslatedString', 'is_object', 'is_numeric', 'php7_sizeof', 'method_exists'); diff --git a/layouts/v7/modules/Documents/CreateDocument.tpl b/layouts/v7/modules/Documents/CreateDocument.tpl index c865415b9..8f505629f 100644 --- a/layouts/v7/modules/Documents/CreateDocument.tpl +++ b/layouts/v7/modules/Documents/CreateDocument.tpl @@ -22,9 +22,9 @@ <input type="hidden" name="module" value="{$MODULE}" /> <input type="hidden" name="action" value="SaveAjax" /> <input type="hidden" name="document_source" value="Vtiger" /> - <input type="hidden" name='service' value="{$STORAGE_SERVICE}" /> + <input type="hidden" name='service' value="{if isset($STORAGE_SERVICE)}{$STORAGE_SERVICE}{/if}" /> <input type="hidden" name='type' value="{$FILE_LOCATION_TYPE}" /> - {if $RELATION_OPERATOR eq 'true'} + {if isset($RELATION_OPERATOR) && $RELATION_OPERATOR eq 'true'} <input type="hidden" name="relationOperation" value="{$RELATION_OPERATOR}" /> <input type="hidden" name="sourceModule" value="{$PARENT_MODULE}" /> <input type="hidden" name="sourceRecord" value="{$PARENT_ID}" /> diff --git a/layouts/v7/modules/Documents/ModuleHeader.tpl b/layouts/v7/modules/Documents/ModuleHeader.tpl index 2c3db7718..92ebd4333 100644 --- a/layouts/v7/modules/Documents/ModuleHeader.tpl +++ b/layouts/v7/modules/Documents/ModuleHeader.tpl @@ -41,7 +41,7 @@ <p class="current-filter-name filter-name pull-left cursorPointer" title="{$CVNAME}"> <span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a href='{$MODULE_MODEL->getListViewUrl()}&viewname={$VIEWID}'> {$CVNAME} </a> </p> {/if} {assign var=SINGLE_MODULE_NAME value='SINGLE_'|cat:$MODULE} - {if $RECORD and $REQ->get('view') eq 'Edit'} + {if isset($RECORD) and $REQ->get('view') eq 'Edit'} <p class="current-filter-name filter-name pull-left "><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a title="{$RECORD->get('label')}"> {vtranslate('LBL_EDITING', $MODULE)} : {$RECORD->get('label')} </a></p> {else if $REQ->get('view') eq 'Edit'} <p class="current-filter-name filter-name pull-left "><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a> {vtranslate('LBL_ADDING_NEW', $MODULE)} </a></p> diff --git a/layouts/v7/modules/Documents/UploadDocument.tpl b/layouts/v7/modules/Documents/UploadDocument.tpl index ffd5b66fb..10ac0db6a 100644 --- a/layouts/v7/modules/Documents/UploadDocument.tpl +++ b/layouts/v7/modules/Documents/UploadDocument.tpl @@ -23,7 +23,7 @@ <input type="hidden" name="module" value="{$MODULE}" /> <input type="hidden" name="action" value="SaveAjax" /> <input type="hidden" name="document_source" value="Vtiger" /> - {if $RELATION_OPERATOR eq 'true'} + {if isset($RELATION_OPERATOR) && $RELATION_OPERATOR eq 'true'} <input type="hidden" name="relationOperation" value="{$RELATION_OPERATOR}" /> <input type="hidden" name="sourceModule" value="{$PARENT_MODULE}" /> <input type="hidden" name="sourceRecord" value="{$PARENT_ID}" /> @@ -47,7 +47,7 @@ <div class="fileUploadBtn btn btn-primary"> <span><i class="fa fa-laptop"></i> {vtranslate('LBL_SELECT_FILE_FROM_COMPUTER', $MODULE)}</span> {assign var=FIELD_MODEL value=$FIELD_MODELS['filename']} - <input type="file" name="{$FIELD_MODEL->getFieldName()}" value="{$FIELD_VALUE}" data-rule-required="true" /> + <input type="file" name="{$FIELD_MODEL->getFieldName()}" value="{if isset($FIELD_VALUE)}{$FIELD_VALUE}{/if}" data-rule-required="true" /> </div> <i class="fa fa-info-circle cursorPointer" data-toggle="tooltip" title="{vtranslate('LBL_MAX_UPLOAD_SIZE', $MODULE)} {$MAX_UPLOAD_LIMIT_MB}{vtranslate('MB', $MODULE)}"></i> </div> diff --git a/layouts/v7/modules/Documents/partials/SidebarEssentials.tpl b/layouts/v7/modules/Documents/partials/SidebarEssentials.tpl index 24889f237..29fda74cd 100644 --- a/layouts/v7/modules/Documents/partials/SidebarEssentials.tpl +++ b/layouts/v7/modules/Documents/partials/SidebarEssentials.tpl @@ -152,7 +152,7 @@ <div class="menu-scroller scrollContainer" style="position:relative; top:0; left:0;"> <div class="list-menu-content"> <div id="listViewTagContainer" class="multiLevelTagList" - {if $ALL_CUSTOMVIEW_MODEL} data-view-id="{$ALL_CUSTOMVIEW_MODEL->getId()}" {/if} + {if isset($ALL_CUSTOMVIEW_MODEL)} data-view-id="{$ALL_CUSTOMVIEW_MODEL->getId()}" {/if} data-list-tag-count="{Vtiger_Tag_Model::NUM_OF_TAGS_LIST}"> {foreach item=TAG_MODEL from=$TAGS name=tagCounter} {assign var=TAG_LABEL value=$TAG_MODEL->getName()} diff --git a/layouts/v7/modules/Vtiger/ListViewActions.tpl b/layouts/v7/modules/Vtiger/ListViewActions.tpl index 3dc128c91..17a4d2330 100644 --- a/layouts/v7/modules/Vtiger/ListViewActions.tpl +++ b/layouts/v7/modules/Vtiger/ListViewActions.tpl @@ -39,7 +39,7 @@ <i class="fa fa-trash"></i> </button> {/if} - {if $commentAction} + {if isset($commentAction)} <button type="button" class="btn btn-default" id="{$MODULE}_listView_massAction_{$commentAction->getLabel()}" onclick="Vtiger_List_Js.triggerMassAction('{$commentAction->getUrl()}')" title="{vtranslate('LBL_COMMENT', $MODULE)}" disabled="disabled"> <i class="fa fa-comment"></i> @@ -98,7 +98,7 @@ {if $PRINT_TEMPLATE} <li class="hide"><a id="{$MODULE}_listView_advancedAction_{Vtiger_Util_Helper::replaceSpaceWithUnderScores($PRINT_TEMPLATE->getLabel())}" {if stripos($PRINT_TEMPLATE->getUrl(), 'javascript:')===0} href="javascript:void(0);" onclick='{$PRINT_TEMPLATE->getUrl()|substr:strlen("javascript:")};'{else} href='{$PRINT_TEMPLATE->getUrl()}' {/if}>{vtranslate($PRINT_TEMPLATE->getLabel(), $MODULE)}</a></li> {/if} - {if $FIND_DUPLICATES_EXISTS} + {if isset($FIND_DUPLICATES_EXISTS)} <li class="hide"><a id="{$MODULE}_listView_advancedAction_MERGE_RECORD" href="javascript:void(0);" onclick='Vtiger_List_Js.triggerMergeRecord()'>{vtranslate('LBL_MERGE_SELECTED_RECORDS', $MODULE)}</a></li> {/if} {foreach item=LISTVIEW_ADVANCEDACTIONS from=$LISTVIEW_LINKS['LISTVIEW']} diff --git a/layouts/v7/modules/Vtiger/ListViewContents.tpl b/layouts/v7/modules/Vtiger/ListViewContents.tpl index dba24cbb1..2cea24ff8 100644 --- a/layouts/v7/modules/Vtiger/ListViewContents.tpl +++ b/layouts/v7/modules/Vtiger/ListViewContents.tpl @@ -11,6 +11,10 @@ {* START YOUR IMPLEMENTATION FROM BELOW. Use {debug} for information *} {include file="PicklistColorMap.tpl"|vtemplate_path:$MODULE} +{if !isset($SELECTED_MENU_CATEGORY)} + {assign var=SELECTED_MENU_CATEGORY value=""} +{/if} + <div class="col-sm-12 col-xs-12 "> {if $MODULE neq 'EmailTemplates' && $SEARCH_MODE_RESULTS neq true} {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} diff --git a/layouts/v7/modules/Vtiger/uitypes/String.tpl b/layouts/v7/modules/Vtiger/uitypes/String.tpl index 9ec1f6bea..f5facd92b 100644 --- a/layouts/v7/modules/Vtiger/uitypes/String.tpl +++ b/layouts/v7/modules/Vtiger/uitypes/String.tpl @@ -13,7 +13,7 @@ {assign var="FIELD_INFO" value=$FIELD_MODEL->getFieldInfo()} {assign var="SPECIAL_VALIDATOR" value=$FIELD_MODEL->getValidator()} - {if (!$FIELD_NAME)} + {if !isset($FIELD_NAME)} {assign var="FIELD_NAME" value=$FIELD_MODEL->getFieldName()} {/if} <input id="{$MODULE}_editView_fieldName_{$FIELD_NAME}" type="text" data-fieldname="{$FIELD_NAME}" data-fieldtype="string" class="inputElement {if $FIELD_MODEL->isNameField()}nameField{/if}" name="{$FIELD_NAME}" value="{decode_html($FIELD_MODEL->get('fieldvalue'))|php7_htmlentities}" diff --git a/layouts/v7/modules/Vtiger/uitypes/Text.tpl b/layouts/v7/modules/Vtiger/uitypes/Text.tpl index 9e051d162..63ce500cf 100644 --- a/layouts/v7/modules/Vtiger/uitypes/Text.tpl +++ b/layouts/v7/modules/Vtiger/uitypes/Text.tpl @@ -12,7 +12,7 @@ {strip} {assign var="FIELD_INFO" value=$FIELD_MODEL->getFieldInfo()} {assign var="SPECIAL_VALIDATOR" value=$FIELD_MODEL->getValidator()} -{if (!$FIELD_NAME)} +{if !isset($FIELD_NAME)} {assign var="FIELD_NAME" value=$FIELD_MODEL->getFieldName()} {/if} {if $FIELD_MODEL->get('uitype') eq '19' || $FIELD_MODEL->get('uitype') eq '20'} diff --git a/modules/Documents/Documents.php b/modules/Documents/Documents.php index d5ddd7914..b34a3fd32 100644 --- a/modules/Documents/Documents.php +++ b/modules/Documents/Documents.php @@ -95,8 +95,10 @@ class Documents extends CRMEntity { } $filetype_fieldname = $this->getFileTypeFieldName(); $filename_fieldname = $this->getFile_FieldName(); + $filedownloadcount = null; + $filename = null; if($this->column_fields[$filetype_fieldname] == 'I' ){ - if($_FILES[$filename_fieldname]['name'] != ''){ + if(isset($_FILES[$filename_fieldname]) && $_FILES[$filename_fieldname]['name'] != ''){ $errCode=$_FILES[$filename_fieldname]['error']; if($errCode == 0){ foreach($_FILES as $fileindex => $files) @@ -178,7 +180,7 @@ class Documents extends CRMEntity { foreach($_FILES as $fileindex => $files) { - if($files['name'] != '' && $files['size'] > 0) + if($files['name'] != '' && $files['size'] > 0 && isset($_REQUEST[$fileindex.'_hidden'])) { $files['original_name'] = vtlib_purify($_REQUEST[$fileindex.'_hidden']); $file_saved = $this->uploadAndSaveFile($id,$module,$files); @@ -585,4 +587,4 @@ class Documents extends CRMEntity { return $return_value; } } -?> \ No newline at end of file +?> diff --git a/modules/Documents/models/Record.php b/modules/Documents/models/Record.php index 58080280c..411f13437 100644 --- a/modules/Documents/models/Record.php +++ b/modules/Documents/models/Record.php @@ -21,6 +21,7 @@ class Documents_Record_Model extends Vtiger_Record_Model { function getDownloadFileURL($attachmentId = false) { if ($this->get('filelocationtype') == 'I') { $fileDetails = $this->getFileDetails(); + if (!isset($fileDetails['attachmentsid'])) $fileDetails['attachmentsid'] = ''; return 'index.php?module='. $this->getModuleName() .'&action=DownloadFile&record='. $this->getId() .'&fileid='. $fileDetails['attachmentsid']; } else { return $this->get('filename'); @@ -133,4 +134,4 @@ class Documents_Record_Model extends Vtiger_Record_Model { return $value; } -} \ No newline at end of file +} diff --git a/modules/Documents/views/List.php b/modules/Documents/views/List.php index d61c444ee..ea7387a26 100644 --- a/modules/Documents/views/List.php +++ b/modules/Documents/views/List.php @@ -93,7 +93,7 @@ class Documents_List_View extends Vtiger_List_View { $orderBy = ''; $sortOrder = ''; } - if(empty($listHeaders)) { + if(empty($listHeaders) && $orderParams && isset($orderParams['list_headers'])) { $listHeaders = $orderParams['list_headers']; } if(empty($orderBy) && empty($searchValue) && empty($pageNumber)) { @@ -233,16 +233,16 @@ class Documents_List_View extends Vtiger_List_View { } $viewer->assign('PAGE_NUMBER',$pageNumber); - if(!$this->moduleFieldStructure) { + if(!isset($this->moduleFieldStructure)) { $recordStructure = Vtiger_RecordStructure_Model::getInstanceForModule($listViewModel->getModule(), Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_FILTER); $this->moduleFieldStructure = $recordStructure->getStructure(); } $currentUser = Users_Record_Model::getCurrentUserModel(); - if(!$this->tags) { + if(!isset($this->tags)) { $this->tags = Vtiger_Tag_Model::getAllAccessible($currentUser->id, $moduleName); } - if(!$this->allUserTags) { + if(!isset($this->allUserTags)) { $this->allUserTags = Vtiger_Tag_Model::getAllUserTags($currentUser->getId()); } diff --git a/modules/Documents/views/QuickCreateAjax.php b/modules/Documents/views/QuickCreateAjax.php index 856e0c545..b2f0f81fc 100644 --- a/modules/Documents/views/QuickCreateAjax.php +++ b/modules/Documents/views/QuickCreateAjax.php @@ -81,7 +81,7 @@ class Documents_QuickCreateAjax_View extends Vtiger_IndexAjax_View { $viewer->assign('RELATION_OPERATOR', $relationOperation); $viewer->assign('PARENT_MODULE', $request->get('sourceModule')); $viewer->assign('PARENT_ID', $request->get('sourceRecord')); - if ($relationFieldName) { + if (isset($relationFieldName)) { $viewer->assign('RELATION_FIELD_NAME', $relationFieldName); } } @@ -118,4 +118,4 @@ class Documents_QuickCreateAjax_View extends Vtiger_IndexAjax_View { return $jsScriptInstances; } -} \ No newline at end of file +} diff --git a/modules/Vtiger/helpers/Util.php b/modules/Vtiger/helpers/Util.php index f793b582a..57b862f53 100644 --- a/modules/Vtiger/helpers/Util.php +++ b/modules/Vtiger/helpers/Util.php @@ -105,7 +105,7 @@ class Vtiger_Util_Helper { */ public static function toSafeHTML($input) { global $default_charset; - return htmlentities($input, ENT_QUOTES, $default_charset); + return $input ? htmlentities($input, ENT_QUOTES, $default_charset) : $input; } /** diff --git a/modules/Vtiger/models/Field.php b/modules/Vtiger/models/Field.php index 8fe19db1b..ab3a9af52 100644 --- a/modules/Vtiger/models/Field.php +++ b/modules/Vtiger/models/Field.php @@ -1347,7 +1347,7 @@ class Vtiger_Field_Model extends Vtiger_Field { } public function hasDefaultValue() { - return trim($this->defaultvalue) == '' ? false : true; + return !$this->defaultvalue || trim($this->defaultvalue) == '' ? false : true; } public function isActiveField() { diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 106558c75..3037eca76 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1691,6 +1691,7 @@ class Vtiger_Functions { $result = $adb->pquery($query, array($crmid)); $noofrows = $adb->num_rows($result); if ($noofrows) { + $attachmentIds = array(); for ($i = 0; $i < $noofrows; $i++) { $attachmentIds[] = vtws_getId($WsEntityId,$adb->query_result($result, $i, 'attachmentsid')); } @@ -1715,6 +1716,9 @@ class Vtiger_Functions { * if mark will be true, then we are keeping the strip details in the $markers variable */ public static function strip_base64_data ($input, $mark = false, &$markers = null) { + if (!$input) { + return $input; + } if ($markers === null) { $markers = array(); } @@ -1789,6 +1793,9 @@ class Vtiger_Functions { * if mark will be true, then we are keeping the strip details in the $markers variable */ public static function stripInlineOffice365Image ($input, $mark = false, &$markers = null) { + if (!$input) { + return $input; + } if ($markers === null) { $markers = array(); } -- GitLab