Skip to content
Snippets Groups Projects
Commit bec7ba8c authored by Uma's avatar Uma
Browse files

Fixes #1178 ::Uma::split api is been replaced with preg_split

parent 73318724
No related branches found
No related tags found
1 merge request!460Fixes #1178 ::Uma::split api is been replaced with preg_split
......@@ -827,4 +827,16 @@ function vtlib_addSettingsLink($linkName, $linkURL, $blockName = false) {
return $success;
}
/**
* PHP7 support for split function
* split : Case sensitive.
*/
if (!function_exists('split')) {
function split($pattern, $string, $limit = null) {
$regex = '/' . preg_replace('/\//', '\\/', $pattern) . '/';
return preg_split($regex, $string, $limit);
}
}
?>
\ No newline at end of file
......@@ -66,11 +66,13 @@ class Reports_Detail_View extends Vtiger_Index_View {
$primaryModule = $reportModel->getPrimaryModule();
$secondaryModules = $reportModel->getSecondaryModules();
$modulesList = array($primaryModule);
if(stripos($secondaryModules, ':') >= 0){
$secmodules = split(':', $secondaryModules);
$modulesList = array_merge($modulesList, $secmodules);
}else{
array_push($modulesList, $secondaryModules);
if(!empty($secondaryModules)){
if(stripos($secondaryModules, ':') >= 0){
$secmodules = split(':', $secondaryModules);
$modulesList = array_merge($modulesList, $secmodules);
}else{
array_push($modulesList, $secondaryModules);
}
}
$currentUser = Users_Record_Model::getCurrentUserModel();
$userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment