Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18759

CRM_Utils_Type::validate($data, 'String') should fail for non-string-like values of $data

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 4.7.8
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      For example, this is weird:

      if (CRM_Utils_Type::validate(new stdClass(), 'String')) {
        echo "Object is a string\n";
      }
      if (CRM_Utils_Type::validate(array(), 'String')) {
        echo "Array is a string\n";
      }
      

      Output:

      Object is a string
      Array is a string
      

        Attachments

          Activity

            People

            • Assignee:
              allenshaw Allen Shaw
              Reporter:
              allenshaw Allen Shaw
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: