Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
J
Joomla
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
  • Development
  • Joomla
  • Issues
  • #9

Closed
Open
Opened Mar 26, 2019 by spalmstrom@spalmstrom

htmlspecialchars() expects parameter 1 to be string, array given in .../administrator/components/com_civicrm/civicrm/packages/HTML/Common.php on line 144

Warning: htmlspecialchars() expects parameter 1 to be string, array given in .../administrator/components/com_civicrm/civicrm/packages/HTML/Common.php on line 144 under Joomla and CiviCRM 5.11.0 when running Event Reports -> Attendee List. There is no longer a Joomla demo site it seems, so cannot reproduce there. It seems linked to an empty custom field value, but I'm not sure which one.Annotation_2019-03-26_173944

A workaround is to test for the value type before attempting to call htmlspecialchars:

      if (is_array($value)) {
              if (count($value) == 0) {
                $value1 = '';  // an empty string
                $strAttr .= ' ' . $key . '="' . htmlspecialchars($value1, ENT_COMPAT, $charset) . '"';
              }
              else {
                foreach ($value as $value1) {
                  $strAttr .= ' ' . $key . '="' . htmlspecialchars($value1, ENT_COMPAT, $charset) . '"';
                }
              }
            }
            else {
              $strAttr .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
            }
        }

Has anyone any comments?

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/joomla#9