2 Replies Latest reply on Jul 20, 2010 8:17 AM by TSGal

    Some values behave like wildcards in PHP API search

    RobertSinton

      Summary

      Some values behave like wildcards in PHP API search

      Product

      FileMaker Pro

      Version

      11

      Operating system version

      OS X 10.6

      Description of the issue

      Some values, when searched for, seem to match against any record.

      This was observed when a user entered a high unicode character into a utf-8 web page. After sanitising with PHP's htmlentities() function, the resuling string did not restrict the found set when used in a two-field search: the result was the same as if the search had been done on only the first field.

      Steps to reproduce the problem

      <?php

      # Sanitise input values
      $Login    = htmlentities( $_REQUEST['Login'] );
      $Password = htmlentities( $_REQUEST['Password'] );

      # Search for matching user record.
      $fm = fmfactory();
      $findReq =& $fm->newFindCommand( 'Users' );
      $findReq->addFindCriterion( 'Login', '=="' . $Login . '"' );
      $findReq->addFindCriterion( 'Password', '=="' . $Password . '"' );
      $result = $findReq->execute();

      ?>

      Expected result

      The script above should find only records with the given Login and Password values.

      Actual result

      If the input value for Password is "Ø" (Scandinavian O with a slash through it, other characters also triggered the problem), this search finds the user record for the given Login, regardless of what the record's Password value is.

        • 1. Re: Some values behave like wildcards in PHP API search
          TSGal

          Robert Sinton:

          Thank you for your post.

          I have forwarded your entire post to our Development and Software Quality Assurance (Testing) departments for review and confirmation.  As information becomes available to me, I will let you know.

          TSGal
          FileMaker, Inc.

          • 2. Re: Some values behave like wildcards in PHP API search
            TSGal

            Robert Sinton:

            Our Testing department was able to reproduce the problem.  They have sent back the following information:

            "... The character Ø in search field returns all records, but when I save the PHP file itself as UTF-8, the problem went away.  Please ask your customer to open the PHP in an application like BBEdit and save as UTF-8.  Basically, the file needs to be encoded as UTF-8."

            Please try this out and let me know if this works.

            TSGal
            FileMaker, Inc.