Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with some documents when the ${ part is splited #596

Open
edyan opened this issue Aug 20, 2015 · 0 comments
Open

Issue with some documents when the ${ part is splited #596

edyan opened this issue Aug 20, 2015 · 0 comments

Comments

@edyan
Copy link

edyan commented Aug 20, 2015

Hi,

If you have a document where some variables are splited in the XML in parts, the regex doesn't work. I have done these changes to the code:

  • getVariablesForPart =>

changed

    preg_match_all('/\$\{(.*?)}/i', $documentPartXML, $matches);

to

    preg_match_all('/\$\{(.*?)}/i', strip_tags($documentPartXML), $matches);

That makes the search faster and gives the warranty to find the variables

  • setValueForPart

Changed to pattern and exit if no match

        $pattern = '/\$((.|\n)*?)\{((.|\n)*?)\}/m';
        preg_match_all($pattern, $documentPartXML, $matches);
        if (empty($matches[0])) {
            return $documentPartXML;
        }

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant