mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Merge pull request #16209 from uberbrady/eliminate_preg_split_deprecation_warnings
Fixed #16208 - don't call preg_split() with a null
This commit is contained in:
commit
b48704b3af
|
@ -62,7 +62,7 @@ class SettingsSamlRequest extends FormRequest
|
||||||
$custom_privateKey = '';
|
$custom_privateKey = '';
|
||||||
$custom_x509certNew = '';
|
$custom_x509certNew = '';
|
||||||
if (! empty($this->input('saml_custom_settings'))) {
|
if (! empty($this->input('saml_custom_settings'))) {
|
||||||
$req_custom_settings = preg_split('/\r\n|\r|\n/', $this->input('saml_custom_settings'));
|
$req_custom_settings = preg_split('/\r\n|\r|\n/', $this->input('saml_custom_settings', ''));
|
||||||
$custom_settings = [];
|
$custom_settings = [];
|
||||||
|
|
||||||
foreach ($req_custom_settings as $custom_setting) {
|
foreach ($req_custom_settings as $custom_setting) {
|
||||||
|
|
|
@ -307,7 +307,7 @@ class CustomField extends Model
|
||||||
public function formatFieldValuesAsArray()
|
public function formatFieldValuesAsArray()
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
$arr = preg_split('/\\r\\n|\\r|\\n/', $this->field_values);
|
$arr = preg_split('/\\r\\n|\\r|\\n/', $this->field_values ?? '');
|
||||||
|
|
||||||
if (($this->element != 'checkbox') && ($this->element != 'radio')) {
|
if (($this->element != 'checkbox') && ($this->element != 'radio')) {
|
||||||
$result[''] = 'Select '.strtolower($this->format);
|
$result[''] = 'Select '.strtolower($this->format);
|
||||||
|
|
|
@ -209,7 +209,7 @@ class Saml
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$custom_settings = preg_split('/\r\n|\r|\n/', $setting->saml_custom_settings);
|
$custom_settings = preg_split('/\r\n|\r|\n/', $setting->saml_custom_settings ?? '');
|
||||||
if ($custom_settings) {
|
if ($custom_settings) {
|
||||||
foreach ($custom_settings as $custom_setting) {
|
foreach ($custom_settings as $custom_setting) {
|
||||||
$split = explode('=', $custom_setting, 2);
|
$split = explode('=', $custom_setting, 2);
|
||||||
|
|
Loading…
Reference in a new issue