Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-2734

EnvSource multiple email delimiter PHP 8.x

    XMLWordPrintable

Details

    Description

      The code in petition-attributes.inc in app/View/CoPetitions 

                      } elseif(strpos($fieldName, 'EnrolleeCoPerson.EmailAddress') !== false) {
                        $email_list = $args['default'];
                        if(!empty($email_list) && !empty($vv_envsource_delimiter)) {
                          $delimiter = "";
                          if($vv_envsource_delimiter == AuthProviderEnum::Shibboleth) {
                            $delimiter = ";";
                          } elseif($vv_envsource_delimiter == AuthProviderEnum::Simplesamlphp) {
                            $delimiter =",";
                          }                    $emails = explode($delimiter, $email_list);
                          if(is_array($emails) && count($emails) > 1) {
                            // XXX We are only keeping the first email
                            $args['value'] = $emails[0];
                          }
                        }
                      } 

      initializes $delimiter to an empty string. The logic only changes $delimiter to a non-empty string if the configuration of the EnvSource is for Shibboleth SP or SimpleSAML php. If the configuration is Other then $delimiter remains an empty string.

      The bug is that explode() cannot take an empty string as the first argument for PHP 8.x. If the first argument is an empty string then explode() throws a ValueError. 

      So the default now throws a ValueError.

      Attachments

        Issue Links

          Activity

            People

              scott.koranda@at.internet2.edu Scott Koranda (uwm.edu/illinois.edu)
              scott.koranda@at.internet2.edu Scott Koranda (uwm.edu/illinois.edu)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: