Adds some PHP 8 ready changes to compiler classes. Adds Server and Crypt classes.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -406,11 +406,11 @@ class Structure extends Get
|
||||
. CFactory::_('Config')->joomla_version;
|
||||
$this->componentBackupName = 'com_'
|
||||
. $this->componentData->sales_name . '_v' . str_replace(
|
||||
'.', '_', $this->componentData->component_version
|
||||
'.', '_', (string) $this->componentData->component_version
|
||||
) . '__J' . CFactory::_('Config')->joomla_version;
|
||||
$this->componentFolderName = 'com_'
|
||||
. $this->componentData->name_code . '_v' . str_replace(
|
||||
'.', '_', $this->componentData->component_version
|
||||
'.', '_', (string) $this->componentData->component_version
|
||||
) . '__J' . CFactory::_('Config')->joomla_version;
|
||||
// set component folder path
|
||||
$this->componentPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/'
|
||||
@ -761,7 +761,7 @@ class Structure extends Get
|
||||
&& StringHelper::check($css))
|
||||
{
|
||||
// make sure this script does not have PHP
|
||||
if (strpos($css, '<?php') === false)
|
||||
if (strpos((string) $css, '<?php') === false)
|
||||
{
|
||||
// make sure the field is added
|
||||
$module->add_scripts_field = true;
|
||||
@ -796,7 +796,7 @@ class Structure extends Get
|
||||
&& StringHelper::check($javascript))
|
||||
{
|
||||
// make sure this script does not have PHP
|
||||
if (strpos($javascript, '<?php') === false)
|
||||
if (strpos((string) $javascript, '<?php') === false)
|
||||
{
|
||||
// make sure the field is added
|
||||
$module->add_scripts_field = true;
|
||||
@ -924,9 +924,9 @@ class Structure extends Get
|
||||
// check if we have an double fields naming set
|
||||
$field_name_inner = '';
|
||||
$field_name_outer = $field_name;
|
||||
if (strpos($field_name, '.') !== false)
|
||||
if (strpos((string) $field_name, '.') !== false)
|
||||
{
|
||||
$field_names = explode('.', $field_name);
|
||||
$field_names = explode('.', (string) $field_name);
|
||||
if (count((array) $field_names) == 2)
|
||||
{
|
||||
$field_name_outer = $field_names[0];
|
||||
@ -1124,7 +1124,7 @@ class Structure extends Get
|
||||
))
|
||||
{
|
||||
// set file name
|
||||
$fileName = basename($url['url']);
|
||||
$fileName = basename((string) $url['url']);
|
||||
// get the file contents
|
||||
$data = FileHelper::getContent(
|
||||
$url['url']
|
||||
@ -1333,9 +1333,9 @@ class Structure extends Get
|
||||
// check if we have an double fields naming set
|
||||
$field_name_inner = '';
|
||||
$field_name_outer = $field_name;
|
||||
if (strpos($field_name, '.') !== false)
|
||||
if (strpos((string) $field_name, '.') !== false)
|
||||
{
|
||||
$field_names = explode('.', $field_name);
|
||||
$field_names = explode('.', (string) $field_name);
|
||||
if (count((array) $field_names) == 2)
|
||||
{
|
||||
$field_name_outer = $field_names[0];
|
||||
@ -1361,16 +1361,16 @@ class Structure extends Get
|
||||
if (!isset($plugin->add_rule_path[$file . $field_name . $fieldset]))
|
||||
{
|
||||
$plugin->add_rule_path[$file . $field_name . $fieldset] =
|
||||
'/plugins/' . strtolower($plugin->group
|
||||
) . '/' . strtolower($plugin->code_name)
|
||||
'/plugins/' . strtolower((string) $plugin->group
|
||||
) . '/' . strtolower((string) $plugin->code_name)
|
||||
. '/rules';
|
||||
}
|
||||
|
||||
if (!isset($plugin->add_field_path[$file . $field_name . $fieldset]))
|
||||
{
|
||||
$plugin->add_field_path[$file . $field_name . $fieldset] =
|
||||
'/plugins/' . strtolower($plugin->group
|
||||
) . '/' . strtolower($plugin->code_name)
|
||||
'/plugins/' . strtolower((string) $plugin->group
|
||||
) . '/' . strtolower((string) $plugin->code_name)
|
||||
. '/fields';
|
||||
}
|
||||
}
|
||||
@ -1515,7 +1515,7 @@ class Structure extends Get
|
||||
))
|
||||
{
|
||||
// set file name
|
||||
$fileName = basename($url['url']);
|
||||
$fileName = basename((string) $url['url']);
|
||||
// get the file contents
|
||||
$data = FileHelper::getContent(
|
||||
$url['url']
|
||||
@ -1636,7 +1636,7 @@ class Structure extends Get
|
||||
$libFolder = strtolower(
|
||||
preg_replace(
|
||||
'/\s+/', '-',
|
||||
StringHelper::safe(
|
||||
(string) StringHelper::safe(
|
||||
$library->name, 'filename', ' ', false
|
||||
)
|
||||
)
|
||||
@ -1660,7 +1660,7 @@ class Structure extends Get
|
||||
// add local folder
|
||||
$addLocalFolder = true;
|
||||
// set file name
|
||||
$fileName = basename($url['url']);
|
||||
$fileName = basename((string) $url['url']);
|
||||
// get the file contents
|
||||
$data = FileHelper::getContent(
|
||||
$url['url']
|
||||
@ -1742,10 +1742,10 @@ class Structure extends Get
|
||||
&& StringHelper::check(
|
||||
$this->componentData->dashboard
|
||||
)
|
||||
&& strpos($this->componentData->dashboard, '_') !== false)
|
||||
&& strpos((string) $this->componentData->dashboard, '_') !== false)
|
||||
{
|
||||
// set the default view
|
||||
$getter = explode('_', $this->componentData->dashboard);
|
||||
$getter = explode('_', (string) $this->componentData->dashboard);
|
||||
if (count((array) $getter) == 2 && is_numeric($getter[1]))
|
||||
{
|
||||
// the pointers
|
||||
@ -2061,7 +2061,7 @@ class Structure extends Get
|
||||
$this->notNew[] = 'LICENSE.txt';
|
||||
// do license check
|
||||
$LICENSE = false;
|
||||
$licenseChecker = strtolower($this->componentData->license);
|
||||
$licenseChecker = strtolower((string) $this->componentData->license);
|
||||
if (strpos($licenseChecker, 'gnu') !== false
|
||||
&& strpos(
|
||||
$licenseChecker, '2'
|
||||
@ -2097,7 +2097,7 @@ class Structure extends Get
|
||||
}
|
||||
else
|
||||
{
|
||||
$new = str_replace($details->rename, $codeName, $item);
|
||||
$new = str_replace($details->rename, $codeName, (string) $item);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2120,20 +2120,20 @@ class Structure extends Get
|
||||
{
|
||||
// set destination path
|
||||
$zipPath = str_replace(
|
||||
$details->_target['type'] . '/', '', $details->path
|
||||
$details->_target['type'] . '/', '', (string) $details->path
|
||||
);
|
||||
$path = str_replace(
|
||||
$details->_target['type'] . '/',
|
||||
$this->dynamicPaths[$details->_target['key']] . '/',
|
||||
$details->path
|
||||
(string) $details->path
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// set destination path
|
||||
$zipPath = str_replace('c0mp0n3nt/', '', $details->path);
|
||||
$zipPath = str_replace('c0mp0n3nt/', '', (string) $details->path);
|
||||
$path = str_replace(
|
||||
'c0mp0n3nt/', $this->componentPath . '/', $details->path
|
||||
'c0mp0n3nt/', $this->componentPath . '/', (string) $details->path
|
||||
);
|
||||
}
|
||||
// set the template folder path
|
||||
@ -2141,9 +2141,9 @@ class Structure extends Get
|
||||
? (($details->custom !== 'full') ? $this->templatePathCustom
|
||||
. '/' : '') : $this->templatePath . '/';
|
||||
// set the final paths
|
||||
$currentFullPath = (preg_match('/^[a-z]:/i', $item)) ? $item
|
||||
$currentFullPath = (preg_match('/^[a-z]:/i', (string) $item)) ? $item
|
||||
: $templatePath . '/' . $item;
|
||||
$currentFullPath = str_replace('//', '/', $currentFullPath);
|
||||
$currentFullPath = str_replace('//', '/', (string) $currentFullPath);
|
||||
$packageFullPath = str_replace('//', '/', $path . '/' . $new);
|
||||
$zipFullPath = str_replace(
|
||||
'//', '/', $zipPath . '/' . $new
|
||||
@ -2545,7 +2545,7 @@ class Structure extends Get
|
||||
'trim',
|
||||
explode(
|
||||
',',
|
||||
GetHelper::between(
|
||||
(string) GetHelper::between(
|
||||
$multi_field['settings']->xml, 'fields="', '"'
|
||||
)
|
||||
)
|
||||
@ -2578,7 +2578,7 @@ class Structure extends Get
|
||||
&& StringHelper::check($view['settings']->created))
|
||||
{
|
||||
// first set the main date
|
||||
$date = strtotime($view['settings']->created);
|
||||
$date = strtotime((string) $view['settings']->created);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2604,7 +2604,7 @@ class Structure extends Get
|
||||
&& StringHelper::check($view['settings']->modified)
|
||||
&& '0000-00-00 00:00:00' !== $view['settings']->modified)
|
||||
{
|
||||
$date = strtotime($view['settings']->modified);
|
||||
$date = strtotime((string) $view['settings']->modified);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2637,7 +2637,7 @@ class Structure extends Get
|
||||
!== $field['settings']->modified)
|
||||
{
|
||||
$anotherDate = strtotime(
|
||||
$field['settings']->modified
|
||||
(string) $field['settings']->modified
|
||||
);
|
||||
if ($anotherDate > $date)
|
||||
{
|
||||
@ -2662,7 +2662,7 @@ class Structure extends Get
|
||||
!== $view['settings']->main_get->modified)
|
||||
{
|
||||
$anotherDate = strtotime(
|
||||
$view['settings']->main_get->modified
|
||||
(string) $view['settings']->main_get->modified
|
||||
);
|
||||
if ($anotherDate > $date)
|
||||
{
|
||||
@ -2685,7 +2685,7 @@ class Structure extends Get
|
||||
!== $view['settings']->main_get->modified)
|
||||
{
|
||||
$anotherDate = strtotime(
|
||||
$view['settings']->main_get->modified
|
||||
(string) $view['settings']->main_get->modified
|
||||
);
|
||||
if ($anotherDate > $date)
|
||||
{
|
||||
@ -2745,20 +2745,20 @@ class Structure extends Get
|
||||
{
|
||||
// set destination path
|
||||
$path = '';
|
||||
if (strpos($details->path, 'VIEW') !== false)
|
||||
if (strpos((string) $details->path, 'VIEW') !== false)
|
||||
{
|
||||
$path = str_replace('VIEW', $name, $details->path);
|
||||
$path = str_replace('VIEW', $name, (string) $details->path);
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = $details->path;
|
||||
}
|
||||
// make sure we have component to replace
|
||||
if (strpos($path, 'c0mp0n3nt') !== false)
|
||||
if (strpos((string) $path, 'c0mp0n3nt') !== false)
|
||||
{
|
||||
$zipPath = str_replace('c0mp0n3nt/', '', $path);
|
||||
$zipPath = str_replace('c0mp0n3nt/', '', (string) $path);
|
||||
$path = str_replace(
|
||||
'c0mp0n3nt/', $this->componentPath . '/', $path
|
||||
'c0mp0n3nt/', $this->componentPath . '/', (string) $path
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -2786,7 +2786,7 @@ class Structure extends Get
|
||||
if ($fileName)
|
||||
{
|
||||
$new = str_replace(
|
||||
$details->rename, $fileName, $item
|
||||
$details->rename, $fileName, (string) $item
|
||||
);
|
||||
$name = $name . '_' . $fileName;
|
||||
}
|
||||
@ -2797,7 +2797,7 @@ class Structure extends Get
|
||||
else
|
||||
{
|
||||
$new = str_replace(
|
||||
$details->rename, $name, $item
|
||||
$details->rename, $name, (string) $item
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -2849,7 +2849,7 @@ class Structure extends Get
|
||||
if (File::exists($custom_settings))
|
||||
{
|
||||
$version_data = json_decode(
|
||||
FileHelper::getContent(
|
||||
(string) FileHelper::getContent(
|
||||
$custom_settings
|
||||
)
|
||||
);
|
||||
@ -2857,7 +2857,7 @@ class Structure extends Get
|
||||
else
|
||||
{
|
||||
$version_data = json_decode(
|
||||
FileHelper::getContent(
|
||||
(string) FileHelper::getContent(
|
||||
$this->templatePath . '/settings.json'
|
||||
)
|
||||
);
|
||||
@ -2938,7 +2938,7 @@ class Structure extends Get
|
||||
if (isset($custom['path'])
|
||||
&& StringHelper::check($custom['path']))
|
||||
{
|
||||
$custom['path'] = trim($custom['path'], '/');
|
||||
$custom['path'] = trim((string) $custom['path'], '/');
|
||||
}
|
||||
// by default custom path is true
|
||||
$customPath = 'custom';
|
||||
@ -2961,14 +2961,14 @@ class Structure extends Get
|
||||
$customPath = 'full';
|
||||
}
|
||||
// make sure we use the correct name
|
||||
$pathArray = (array) explode('/', $custom['path']);
|
||||
$pathArray = (array) explode('/', (string) $custom['path']);
|
||||
$firstFolder = array_values($pathArray)[0];
|
||||
$lastFolder = end($pathArray);
|
||||
// only rename folder if last has folder name
|
||||
if (isset($custom['rename']) && $custom['rename'] == 1)
|
||||
{
|
||||
$custom['path'] = str_replace(
|
||||
'/' . $lastFolder, '', $custom['path']
|
||||
'/' . $lastFolder, '', (string) $custom['path']
|
||||
);
|
||||
$rename = 'new';
|
||||
$newname = $lastFolder;
|
||||
@ -2976,7 +2976,7 @@ class Structure extends Get
|
||||
elseif ('full' === $customPath)
|
||||
{
|
||||
// make sure we use the correct name
|
||||
$folderArray = (array) explode('/', $custom['folder']);
|
||||
$folderArray = (array) explode('/', (string) $custom['folder']);
|
||||
$lastFolder = end($folderArray);
|
||||
$rename = 'new';
|
||||
$newname = $lastFolder;
|
||||
@ -2993,12 +2993,12 @@ class Structure extends Get
|
||||
) . '_f' . $pointer_tracker;
|
||||
$pointer_tracker++;
|
||||
// fix custom path
|
||||
$custom['path'] = ltrim($custom['path'], '/');
|
||||
$custom['path'] = ltrim((string) $custom['path'], '/');
|
||||
// set new folder to object
|
||||
$version_data->move->static->{$key_pointer} = new stdClass();
|
||||
$version_data->move->static->{$key_pointer}->naam
|
||||
= str_replace(
|
||||
'//', '/', $custom['folder']
|
||||
'//', '/', (string) $custom['folder']
|
||||
);
|
||||
$version_data->move->static->{$key_pointer}->path
|
||||
= $_target_type
|
||||
@ -3084,14 +3084,14 @@ class Structure extends Get
|
||||
// set new file to object
|
||||
$version_data->move->static->{$key_pointer} = new stdClass();
|
||||
$version_data->move->static->{$key_pointer}->naam = str_replace(
|
||||
'//', '/', $custom['file']
|
||||
'//', '/', (string) $custom['file']
|
||||
);
|
||||
// update the dynamic component name placholders in file names
|
||||
$custom['path'] = CFactory::_('Placeholder')->update_(
|
||||
$custom['path']
|
||||
);
|
||||
// get the path info
|
||||
$pathInfo = pathinfo($custom['path']);
|
||||
$pathInfo = pathinfo((string) $custom['path']);
|
||||
if (isset($pathInfo['extension']) && $pathInfo['extension'])
|
||||
{
|
||||
$pathInfo['dirname'] = trim($pathInfo['dirname'], '/');
|
||||
@ -3106,9 +3106,9 @@ class Structure extends Get
|
||||
elseif ('full' === $customPath)
|
||||
{
|
||||
// fix custom path
|
||||
$custom['path'] = ltrim($custom['path'], '/');
|
||||
$custom['path'] = ltrim((string) $custom['path'], '/');
|
||||
// get file array
|
||||
$fileArray = (array) explode('/', $custom['file']);
|
||||
$fileArray = (array) explode('/', (string) $custom['file']);
|
||||
// set the info
|
||||
$version_data->move->static->{$key_pointer}->path
|
||||
= $_target_type
|
||||
@ -3121,7 +3121,7 @@ class Structure extends Get
|
||||
else
|
||||
{
|
||||
// fix custom path
|
||||
$custom['path'] = ltrim($custom['path'], '/');
|
||||
$custom['path'] = ltrim((string) $custom['path'], '/');
|
||||
// set the info
|
||||
$version_data->move->static->{$key_pointer}->path
|
||||
= $_target_type
|
||||
|
@ -1956,9 +1956,9 @@ class Fields extends Structure
|
||||
$optionSet = '';
|
||||
if (strtolower($typeName) === 'groupedlist'
|
||||
&& strpos(
|
||||
$value, ','
|
||||
(string) $value, ','
|
||||
) !== false
|
||||
&& strpos($value, '@@') !== false)
|
||||
&& strpos((string) $value, '@@') !== false)
|
||||
{
|
||||
// reset the group temp arrays
|
||||
$groups_ = array();
|
||||
@ -1966,7 +1966,7 @@ class Fields extends Structure
|
||||
'option' => array());
|
||||
$order_ = array();
|
||||
// mulitpal options
|
||||
$options = explode(',', $value);
|
||||
$options = explode(',', (string) $value);
|
||||
foreach ($options as $option)
|
||||
{
|
||||
if (strpos($option, '@@') !== false)
|
||||
@ -2106,10 +2106,10 @@ class Fields extends Structure
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (strpos($value, ',') !== false)
|
||||
elseif (strpos((string) $value, ',') !== false)
|
||||
{
|
||||
// mulitpal options
|
||||
$options = explode(',', $value);
|
||||
$options = explode(',', (string) $value);
|
||||
foreach ($options as $option)
|
||||
{
|
||||
if (strpos($option, '|') !== false)
|
||||
@ -2156,10 +2156,10 @@ class Fields extends Structure
|
||||
else
|
||||
{
|
||||
// one option
|
||||
if (strpos($value, '|') !== false)
|
||||
if (strpos((string) $value, '|') !== false)
|
||||
{
|
||||
// has other value then text
|
||||
list($v, $t) = explode('|', $value);
|
||||
list($v, $t) = explode('|', (string) $value);
|
||||
$langValue = $langView . '_'
|
||||
. FieldHelper::safe(
|
||||
$t, true
|
||||
@ -2283,11 +2283,11 @@ class Fields extends Structure
|
||||
$field .= PHP_EOL . Indent::_(4)
|
||||
. '<fieldset hidden="true" name="'
|
||||
. $fieldAttributes['name'] . '_modal" repeat="true">';
|
||||
if (strpos($fieldAttributes['fields'], ',') !== false)
|
||||
if (strpos((string) $fieldAttributes['fields'], ',') !== false)
|
||||
{
|
||||
// mulitpal fields
|
||||
$fieldsSets = (array) explode(
|
||||
',', $fieldAttributes['fields']
|
||||
',', (string) $fieldAttributes['fields']
|
||||
);
|
||||
}
|
||||
elseif (is_numeric($fieldAttributes['fields']))
|
||||
@ -2449,11 +2449,11 @@ class Fields extends Structure
|
||||
$field .= PHP_EOL . Indent::_(3) . $taber
|
||||
. '<form hidden="true" name="list_'
|
||||
. $fieldAttributes['name'] . '_modal" repeat="true">';
|
||||
if (strpos($fieldAttributes['fields'], ',') !== false)
|
||||
if (strpos((string) $fieldAttributes['fields'], ',') !== false)
|
||||
{
|
||||
// mulitpal fields
|
||||
$fieldsSets = (array) explode(
|
||||
',', $fieldAttributes['fields']
|
||||
',', (string) $fieldAttributes['fields']
|
||||
);
|
||||
}
|
||||
elseif (is_numeric($fieldAttributes['fields']))
|
||||
@ -2640,9 +2640,9 @@ class Fields extends Structure
|
||||
$optionSet = '';
|
||||
if (strtolower($typeName) === 'groupedlist'
|
||||
&& strpos(
|
||||
$value, ','
|
||||
(string) $value, ','
|
||||
) !== false
|
||||
&& strpos($value, '@@') !== false)
|
||||
&& strpos((string) $value, '@@') !== false)
|
||||
{
|
||||
// reset the group temp arrays
|
||||
$groups_ = array();
|
||||
@ -2650,7 +2650,7 @@ class Fields extends Structure
|
||||
'option' => array());
|
||||
$order_ = array();
|
||||
// mulitpal options
|
||||
$options = explode(',', $value);
|
||||
$options = explode(',', (string) $value);
|
||||
foreach ($options as $option)
|
||||
{
|
||||
if (strpos($option, '@@') !== false)
|
||||
@ -2790,10 +2790,10 @@ class Fields extends Structure
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (strpos($value, ',') !== false)
|
||||
elseif (strpos((string) $value, ',') !== false)
|
||||
{
|
||||
// mulitpal options
|
||||
$options = explode(',', $value);
|
||||
$options = explode(',', (string) $value);
|
||||
foreach ($options as $option)
|
||||
{
|
||||
if (strpos($option, '|') !== false)
|
||||
@ -2840,10 +2840,10 @@ class Fields extends Structure
|
||||
else
|
||||
{
|
||||
// one option
|
||||
if (strpos($value, '|') !== false)
|
||||
if (strpos((string) $value, '|') !== false)
|
||||
{
|
||||
// has other value then text
|
||||
list($v, $t) = explode('|', $value);
|
||||
list($v, $t) = explode('|', (string) $value);
|
||||
$langValue = $langView . '_'
|
||||
. FieldHelper::safe(
|
||||
$t, true
|
||||
@ -2972,9 +2972,9 @@ class Fields extends Structure
|
||||
);
|
||||
if (strtolower($typeName) === 'groupedlist'
|
||||
&& strpos(
|
||||
$value, ','
|
||||
(string) $value, ','
|
||||
) !== false
|
||||
&& strpos($value, '@@') !== false)
|
||||
&& strpos((string) $value, '@@') !== false)
|
||||
{
|
||||
// reset the group temp arrays
|
||||
$groups_ = array();
|
||||
@ -2982,7 +2982,7 @@ class Fields extends Structure
|
||||
'option' => array());
|
||||
$order_ = array();
|
||||
// mulitpal options
|
||||
$options = explode(',', $value);
|
||||
$options = explode(',', (string) $value);
|
||||
foreach ($options as $option)
|
||||
{
|
||||
if (strpos($option, '@@') !== false)
|
||||
@ -3125,10 +3125,10 @@ class Fields extends Structure
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (strpos($value, ',') !== false)
|
||||
elseif (strpos((string) $value, ',') !== false)
|
||||
{
|
||||
// mulitpal options
|
||||
$options = explode(',', $value);
|
||||
$options = explode(',', (string) $value);
|
||||
foreach ($options as $option)
|
||||
{
|
||||
$optionXML = $field->fieldXML->addChild('option');
|
||||
@ -3170,10 +3170,10 @@ class Fields extends Structure
|
||||
{
|
||||
// one option
|
||||
$optionXML = $field->fieldXML->addChild('option');
|
||||
if (strpos($value, '|') !== false)
|
||||
if (strpos((string) $value, '|') !== false)
|
||||
{
|
||||
// has other value then text
|
||||
list($v, $t) = explode('|', $value);
|
||||
list($v, $t) = explode('|', (string) $value);
|
||||
$langValue = $langView . '_'
|
||||
. FieldHelper::safe(
|
||||
$t, true
|
||||
@ -3279,11 +3279,11 @@ class Fields extends Structure
|
||||
);
|
||||
$fieldSetXML->addAttribute('repeat', 'true');
|
||||
|
||||
if (strpos($fieldAttributes['fields'], ',') !== false)
|
||||
if (strpos((string) $fieldAttributes['fields'], ',') !== false)
|
||||
{
|
||||
// mulitpal fields
|
||||
$fieldsSets = (array) explode(
|
||||
',', $fieldAttributes['fields']
|
||||
',', (string) $fieldAttributes['fields']
|
||||
);
|
||||
}
|
||||
elseif (is_numeric($fieldAttributes['fields']))
|
||||
@ -3462,11 +3462,11 @@ class Fields extends Structure
|
||||
$form, $attributes
|
||||
);
|
||||
|
||||
if (strpos($fieldAttributes['fields'], ',') !== false)
|
||||
if (strpos((string) $fieldAttributes['fields'], ',') !== false)
|
||||
{
|
||||
// multiple fields
|
||||
$fieldsSets = (array) explode(
|
||||
',', $fieldAttributes['fields']
|
||||
',', (string) $fieldAttributes['fields']
|
||||
);
|
||||
}
|
||||
elseif (is_numeric($fieldAttributes['fields']))
|
||||
@ -3657,9 +3657,9 @@ class Fields extends Structure
|
||||
);
|
||||
if (strtolower($typeName) === 'groupedlist'
|
||||
&& strpos(
|
||||
$value, ','
|
||||
(string) $value, ','
|
||||
) !== false
|
||||
&& strpos($value, '@@') !== false)
|
||||
&& strpos((string) $value, '@@') !== false)
|
||||
{
|
||||
// reset the group temp arrays
|
||||
$groups_ = array();
|
||||
@ -3667,7 +3667,7 @@ class Fields extends Structure
|
||||
'option' => array());
|
||||
$order_ = array();
|
||||
// mulitpal options
|
||||
$options = explode(',', $value);
|
||||
$options = explode(',', (string) $value);
|
||||
foreach ($options as $option)
|
||||
{
|
||||
if (strpos($option, '@@') !== false)
|
||||
@ -3810,10 +3810,10 @@ class Fields extends Structure
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (strpos($value, ',') !== false)
|
||||
elseif (strpos((string) $value, ',') !== false)
|
||||
{
|
||||
// municipal options
|
||||
$options = explode(',', $value);
|
||||
$options = explode(',', (string) $value);
|
||||
foreach ($options as $option)
|
||||
{
|
||||
$optionXML = $field->fieldXML->addChild('option');
|
||||
@ -3855,10 +3855,10 @@ class Fields extends Structure
|
||||
{
|
||||
// one option
|
||||
$optionXML = $field->fieldXML->addChild('option');
|
||||
if (strpos($value, '|') !== false)
|
||||
if (strpos((string) $value, '|') !== false)
|
||||
{
|
||||
// has other value then text
|
||||
list($v, $t) = explode('|', $value);
|
||||
list($v, $t) = explode('|', (string) $value);
|
||||
$langValue = $langView . '_'
|
||||
. FieldHelper::safe(
|
||||
$t, true
|
||||
@ -4053,7 +4053,7 @@ class Fields extends Structure
|
||||
foreach ($this->siteFields[$view][$field] as $codeString => $array)
|
||||
{
|
||||
// get the code array
|
||||
$codeArray = explode('___', $codeString);
|
||||
$codeArray = explode('___', (string) $codeString);
|
||||
// set the code
|
||||
$code = trim($codeArray[0]);
|
||||
// set the decoding methods
|
||||
@ -4189,18 +4189,18 @@ class Fields extends Structure
|
||||
);
|
||||
}
|
||||
// catch all PHP here
|
||||
elseif (strpos($property['name'], 'type_php') !== false
|
||||
elseif (strpos((string) $property['name'], 'type_php') !== false
|
||||
&& $setCustom)
|
||||
{
|
||||
// set the line number
|
||||
$phpLine = (int) preg_replace(
|
||||
'/[^0-9]/', '', $property['name']
|
||||
'/[^0-9]/', '', (string) $property['name']
|
||||
);
|
||||
// set the type key
|
||||
$phpKey = (string) trim(
|
||||
str_replace(
|
||||
'type_', '',
|
||||
preg_replace('/[0-9]+/', '', $property['name'])
|
||||
preg_replace('/[0-9]+/', '', (string) $property['name'])
|
||||
), '_'
|
||||
);
|
||||
// load the php for the custom field file
|
||||
@ -4619,7 +4619,7 @@ class Fields extends Structure
|
||||
&& !is_numeric($number_check))
|
||||
{
|
||||
$number_check = str_replace(
|
||||
',', '.', $field['settings']->datadefault_other
|
||||
',', '.', (string) $field['settings']->datadefault_other
|
||||
);
|
||||
}
|
||||
// check if we have a valid number value
|
||||
@ -4962,14 +4962,14 @@ class Fields extends Structure
|
||||
. $otherView;
|
||||
}
|
||||
// check the context (does our target match)
|
||||
if (strpos($_extension, '.') !== false)
|
||||
if (strpos((string) $_extension, '.') !== false)
|
||||
{
|
||||
$target_view = trim(explode('.', $_extension)[1]);
|
||||
$target_view = trim(explode('.', (string) $_extension)[1]);
|
||||
// from my understanding the target extension view and the otherView must align
|
||||
// so I will here check that it does, and if not raise an error message to fix this
|
||||
if ($target_view !== $otherView)
|
||||
{
|
||||
$target_extension = trim(explode('.', $_extension)[0]);
|
||||
$target_extension = trim(explode('.', (string) $_extension)[0]);
|
||||
$correction = $target_extension . '.' . $otherView;
|
||||
$this->app->enqueueMessage(
|
||||
JText::sprintf(
|
||||
@ -5242,7 +5242,7 @@ class Fields extends Structure
|
||||
$filter_type_code = StringHelper::safe(
|
||||
$nameListCode . 'filter' . $name
|
||||
);
|
||||
$filter_type_code = preg_replace('/_+/', '', $filter_type_code);
|
||||
$filter_type_code = preg_replace('/_+/', '', (string) $filter_type_code);
|
||||
$filter_function_name = StringHelper::safe(
|
||||
$name, 'F'
|
||||
);
|
||||
@ -5338,10 +5338,10 @@ class Fields extends Structure
|
||||
// set J prefix
|
||||
$jprefix = 'J';
|
||||
// check if this field has a dot in field type name
|
||||
if (strpos($data['type'], '.') !== false)
|
||||
if (strpos((string) $data['type'], '.') !== false)
|
||||
{
|
||||
// so we have name spacing in custom field type name
|
||||
$dotTypeArray = explode('.', $data['type']);
|
||||
$dotTypeArray = explode('.', (string) $data['type']);
|
||||
// set the J prefix
|
||||
if (count((array) $dotTypeArray) > 1)
|
||||
{
|
||||
@ -5527,7 +5527,7 @@ class Fields extends Structure
|
||||
);
|
||||
}
|
||||
// check the the JFormHelper::loadFieldClass(..) was set
|
||||
elseif (strpos(CFactory::_('Content')->get_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER'),
|
||||
elseif (strpos((string) CFactory::_('Content')->get_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER'),
|
||||
'JFormHelper::loadFieldClass(') === false)
|
||||
{
|
||||
CFactory::_('Content')->add_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER',
|
||||
@ -5873,7 +5873,7 @@ class Fields extends Structure
|
||||
$field_filter_sets[] = Indent::_(3) . 'type="'
|
||||
. $filter['type'] . '"';
|
||||
// set css classname of this field
|
||||
$filter['class'] = ucfirst($filter['type']);
|
||||
$filter['class'] = ucfirst((string) $filter['type']);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -5881,7 +5881,7 @@ class Fields extends Structure
|
||||
$field_filter_sets[] = Indent::_(3) . 'type="'
|
||||
. $filter['filter_type'] . '"';
|
||||
// set css classname of this field
|
||||
$filter['class'] = ucfirst($filter['filter_type']);
|
||||
$filter['class'] = ucfirst((string) $filter['filter_type']);
|
||||
}
|
||||
$field_filter_sets[] = Indent::_(3) . 'name="'
|
||||
. $filter['code'] . '"';
|
||||
@ -6124,17 +6124,17 @@ class Fields extends Structure
|
||||
$fieldData['component'] = $local_component;
|
||||
}
|
||||
// check that the component has the com_ value in it
|
||||
if (strpos($fieldData['component'], 'com_') === false
|
||||
if (strpos((string) $fieldData['component'], 'com_') === false
|
||||
|| strpos(
|
||||
$fieldData['component'], '='
|
||||
(string) $fieldData['component'], '='
|
||||
) !== false)
|
||||
{
|
||||
$fieldData['component'] = "com_" . $fieldData['component'];
|
||||
}
|
||||
// make sure the component is update if # # # or [ [ [ component placeholder is used
|
||||
if (strpos($fieldData['component'], Placefix::h()) !== false
|
||||
if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false
|
||||
|| strpos(
|
||||
$fieldData['component'], Placefix::b()
|
||||
(string) $fieldData['component'], (string) Placefix::b()
|
||||
) !== false) // should not be needed... but
|
||||
{
|
||||
$fieldData['component'] = CFactory::_('Placeholder')->update_(
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -103,7 +103,7 @@ class Infusion extends Interpretation
|
||||
|
||||
// COMPANYNAME
|
||||
CFactory::_('Content')->set('COMPANYNAME', trim(
|
||||
JFilterOutput::cleanText($this->componentData->companyname)
|
||||
(string) JFilterOutput::cleanText($this->componentData->companyname)
|
||||
));
|
||||
|
||||
// CREATIONDATE
|
||||
@ -121,31 +121,31 @@ class Infusion extends Interpretation
|
||||
|
||||
// AUTHOR
|
||||
CFactory::_('Content')->set('AUTHOR', trim(
|
||||
JFilterOutput::cleanText($this->componentData->author)
|
||||
(string) JFilterOutput::cleanText($this->componentData->author)
|
||||
));
|
||||
|
||||
// AUTHOREMAIL
|
||||
CFactory::_('Content')->set('AUTHOREMAIL', trim($this->componentData->email));
|
||||
CFactory::_('Content')->set('AUTHOREMAIL', trim((string) $this->componentData->email));
|
||||
|
||||
// AUTHORWEBSITE
|
||||
CFactory::_('Content')->set('AUTHORWEBSITE', trim($this->componentData->website));
|
||||
CFactory::_('Content')->set('AUTHORWEBSITE', trim((string) $this->componentData->website));
|
||||
|
||||
// COPYRIGHT
|
||||
CFactory::_('Content')->set('COPYRIGHT', trim($this->componentData->copyright));
|
||||
CFactory::_('Content')->set('COPYRIGHT', trim((string) $this->componentData->copyright));
|
||||
|
||||
// LICENSE
|
||||
CFactory::_('Content')->set('LICENSE', trim($this->componentData->license));
|
||||
CFactory::_('Content')->set('LICENSE', trim((string) $this->componentData->license));
|
||||
|
||||
// VERSION
|
||||
CFactory::_('Content')->set('VERSION', trim($this->componentData->component_version));
|
||||
CFactory::_('Content')->set('VERSION', trim((string) $this->componentData->component_version));
|
||||
// set the actual global version
|
||||
CFactory::_('Content')->set('ACTUALVERSION', CFactory::_('Content')->get('VERSION'));
|
||||
|
||||
// do some Tweaks to the version based on selected options
|
||||
if (strpos(CFactory::_('Content')->get('VERSION'), '.') !== false)
|
||||
if (strpos((string) CFactory::_('Content')->get('VERSION'), '.') !== false)
|
||||
{
|
||||
$versionArray = explode(
|
||||
'.', CFactory::_('Content')->get('VERSION')
|
||||
'.', (string) CFactory::_('Content')->get('VERSION')
|
||||
);
|
||||
}
|
||||
// load only first two values
|
||||
@ -177,13 +177,13 @@ class Infusion extends Interpretation
|
||||
|
||||
// SHORT_DISCRIPTION
|
||||
CFactory::_('Content')->set('SHORT_DESCRIPTION', trim(
|
||||
JFilterOutput::cleanText(
|
||||
(string) JFilterOutput::cleanText(
|
||||
$this->componentData->short_description
|
||||
)
|
||||
));
|
||||
|
||||
// DESCRIPTION
|
||||
CFactory::_('Content')->set('DESCRIPTION', trim($this->componentData->description));
|
||||
CFactory::_('Content')->set('DESCRIPTION', trim((string) $this->componentData->description));
|
||||
|
||||
// COMP_IMAGE_TYPE
|
||||
CFactory::_('Content')->set('COMP_IMAGE_TYPE', $this->setComponentImageType($this->componentData->image));
|
||||
@ -419,7 +419,7 @@ class Infusion extends Interpretation
|
||||
))
|
||||
{
|
||||
CFactory::_('Content')->set_($nameSingleCode, 'DOCUMENT_CUSTOM_PHP', str_replace(
|
||||
'$document->', '$this->document->', $phpDocument
|
||||
'$document->', '$this->document->', (string) $phpDocument
|
||||
));
|
||||
// clear some memory
|
||||
unset($phpDocument);
|
||||
@ -835,7 +835,7 @@ class Infusion extends Interpretation
|
||||
{
|
||||
// only minfy if no php is added to the footer script
|
||||
if (CFactory::_('Config')->get('minify', 0)
|
||||
&& strpos($footerScript, '<?php') === false)
|
||||
&& strpos((string) $footerScript, '<?php') === false)
|
||||
{
|
||||
// minfy the script
|
||||
$minifier = new JS;
|
||||
@ -1425,7 +1425,7 @@ class Infusion extends Interpretation
|
||||
$target = array('admin' => 'a_rule_zi');
|
||||
$this->buildDynamique($target, 'rule', $rule);
|
||||
// set the JFormRule Name
|
||||
CFactory::_('Content')->set_('a_rule_zi_' . $rule, 'Name', ucfirst($rule));
|
||||
CFactory::_('Content')->set_('a_rule_zi_' . $rule, 'Name', ucfirst((string) $rule));
|
||||
// set the JFormRule PHP
|
||||
CFactory::_('Content')->set_('a_rule_zi_' . $rule, 'VALIDATION_RULE_METHODS', PHP_EOL . $_php);
|
||||
}
|
||||
@ -2118,13 +2118,13 @@ class Infusion extends Interpretation
|
||||
foreach ($this->languages['components'] as $tag => $areas)
|
||||
{
|
||||
// trim the tag
|
||||
$tag = trim($tag);
|
||||
$tag = trim((string) $tag);
|
||||
foreach ($areas as $area => $languageStrings)
|
||||
{
|
||||
// set naming convention
|
||||
$p = 'admin';
|
||||
$t = '';
|
||||
if (strpos($area, 'site') !== false)
|
||||
if (strpos((string) $area, 'site') !== false)
|
||||
{
|
||||
if (CFactory::_('Config')->remove_site_folder
|
||||
&& CFactory::_('Config')->remove_site_edit_folder)
|
||||
@ -2133,7 +2133,7 @@ class Infusion extends Interpretation
|
||||
}
|
||||
$p = 'site';
|
||||
}
|
||||
if (strpos($area, 'sys') !== false)
|
||||
if (strpos((string) $area, 'sys') !== false)
|
||||
{
|
||||
$t = '.sys';
|
||||
}
|
||||
|
Reference in New Issue
Block a user