We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    The segmentation fault comes from the recursive pattern ([0-9]+,)* used in the preg_match.
    So even if it is a bit slower (0,029 seconds compared to 0,012 seconds with the previous script) I think I prefer the following function. More simple and more readable few months later wink, without use of character functions like strlen/mbstrlen.
    As the pattern search only for /^[0-9]+$/ we avoid the stack overflow. Thanks for your feedback about this Php issue.

    /**
     *  validListIDs : check the validity of a value separated list of Ids
     */
      function validListIDs($IDs){
        $groups = explode(',',$IDs);
        $nbg = count($groups);
        for($i=0;$i<$nbg;$i++)
          if (preg_match('/^[0-9]+$/',$groups[$i]) == 0) return false;
        return true;
      }


    Issue registered as AJAXSEARCH-33
    This issue should occur with 1.8.1 and 1.8.2 AjaxSearch releases with a large number of private documents.

    [EDIT: Fixed with AjaxSearch 1.8.3]
      • 4018
      • 1,131 Posts
      Looks like that does the trick. Thanks a bunch! laugh
        Jeff Whitfield

        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."