Wrapper not working when Header or Footer contains spaced Text #2

Closed
mohitp opened this Issue Oct 23, 2012 · 28 comments

Comments

Projects
None yet
2 participants
@mohitp

mohitp commented Oct 23, 2012

When the --header-* or --footer-* option is set with a string containing spaces, the wrapper does not output the result.

For example, this option is not working:
$pdf->setOptions(array('header-left'=>'"ABC A"', ));

Altering the nested quotes in any combination of single/double quotes is also not working. Also, escaping " with \ is not working. But the $command string created by the wrapper works fine when pasted directly at the command prompt.

In the Windows version, the error thrown is:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
where $bin is set to "C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf"

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 23, 2012

Found the reason. The bug seems to be with PHP proc_open:
https://bugs.php.net/bug.php?id=49139

The solution i implemented was to make a small change in the createPdf function

protected function createPdf($fileName)
{
    $command = '"' . $this->getCommand($fileName) . '"';
    ...
}

mohitp commented Oct 23, 2012

Found the reason. The bug seems to be with PHP proc_open:
https://bugs.php.net/bug.php?id=49139

The solution i implemented was to make a small change in the createPdf function

protected function createPdf($fileName)
{
    $command = '"' . $this->getCommand($fileName) . '"';
    ...
}

@mohitp mohitp closed this Oct 23, 2012

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 24, 2012

Owner

Thanks for your bug report. I will add the solution to the next release. I just wonder, if it's really the best way to fix this.

Did you try this only on Windows servers? I didn't try it yet, but on Linux i would expect, that you have to put single quotes around string arguments with spaces. We need to make sure, that the solution works everywhere.

Owner

mikehaertl commented Oct 24, 2012

Thanks for your bug report. I will add the solution to the next release. I just wonder, if it's really the best way to fix this.

Did you try this only on Windows servers? I didn't try it yet, but on Linux i would expect, that you have to put single quotes around string arguments with spaces. We need to make sure, that the solution works everywhere.

@mikehaertl mikehaertl reopened this Oct 24, 2012

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 24, 2012

I havent tried it on Linux. I am working on a local system with Windows 7, PHP 5.3.9 and Apache 2.2
But the final implementation would most probably be in Linux.

Just to re-emphasize, the quotes are present in the string containing spaces. The fix in the proc_open is on top of it. Without the fix, this problem also occurs while using header-html or footer-html and if more than one parameter is used in the html url (even with the complete html url being enclosed within quotes), ex:
'header-html'=>'"header.html?p1=ABC&p2=QWE"'

mohitp commented Oct 24, 2012

I havent tried it on Linux. I am working on a local system with Windows 7, PHP 5.3.9 and Apache 2.2
But the final implementation would most probably be in Linux.

Just to re-emphasize, the quotes are present in the string containing spaces. The fix in the proc_open is on top of it. Without the fix, this problem also occurs while using header-html or footer-html and if more than one parameter is used in the html url (even with the complete html url being enclosed within quotes), ex:
'header-html'=>'"header.html?p1=ABC&p2=QWE"'

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 24, 2012

One of the comments in the PHP bug report, by xandrani at googlemail dot com says that using exec() worked for him. But i dont know if that can be a cross-platform solution.

mohitp commented Oct 24, 2012

One of the comments in the PHP bug report, by xandrani at googlemail dot com says that using exec() worked for him. But i dont know if that can be a cross-platform solution.

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 24, 2012

Owner

Could you please paste a complete command line where you use spaces in header/footer? I want to see how it must look. Meanwhile i try to find a solution for linux.

Thanks!

Owner

mikehaertl commented Oct 24, 2012

Could you please paste a complete command line where you use spaces in header/footer? I want to see how it must look. Meanwhile i try to find a solution for linux.

Thanks!

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 24, 2012

Owner

I've just learned about PHP's escapeshellarg() command. Can you do me a favour and try this out on windows?

You should replace this line on the bottom:

$out .= "--$key $val";

with

$out .= "--$key ".esacpeshellarg($val);

This fixes the problem on linux. You can also use any other character now like ', " or \n.

I guess for windows we still need the double quotes around the complete command. It would be nice if you could verify this.

Owner

mikehaertl commented Oct 24, 2012

I've just learned about PHP's escapeshellarg() command. Can you do me a favour and try this out on windows?

You should replace this line on the bottom:

$out .= "--$key $val";

with

$out .= "--$key ".esacpeshellarg($val);

This fixes the problem on linux. You can also use any other character now like ', " or \n.

I guess for windows we still need the double quotes around the complete command. It would be nice if you could verify this.

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 24, 2012

Using esacpeshellarg($val) did not work. There is no error. The program fails silently. I tried inserting try-catch blocks also, but there is no (catchable) error thrown.

It did not work with or without the patch i am employing.

mohitp commented Oct 24, 2012

Using esacpeshellarg($val) did not work. There is no error. The program fails silently. I tried inserting try-catch blocks also, but there is no (catchable) error thrown.

It did not work with or without the patch i am employing.

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 24, 2012

With reference to your previous comment for the command line string, the command generated through the wrapper, is like this (this is with the patch i have applied locally):

""C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf" --no-outline --page-size A4 --orientation Portrait --footer-right "Page [page] of [toPage]" --footer-spacing 3 C:\Windows\Temp\tmpDDC5.tmp.html C:\Windows\Temp\tmpDDD5.tmp"

This works from PHP but not directly in command prompt.
In command prompt i had to remove the beginning and ending double quotes:

"C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf" --no-outline --page-size A4 --orientation Portrait --footer-right "Page [page] of [toPage]" --footer-spacing 3 C:\Windows\Temp\tmpDDC5.tmp.html C:\Windows\Temp\tmpDDD5.tmp

mohitp commented Oct 24, 2012

With reference to your previous comment for the command line string, the command generated through the wrapper, is like this (this is with the patch i have applied locally):

""C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf" --no-outline --page-size A4 --orientation Portrait --footer-right "Page [page] of [toPage]" --footer-spacing 3 C:\Windows\Temp\tmpDDC5.tmp.html C:\Windows\Temp\tmpDDD5.tmp"

This works from PHP but not directly in command prompt.
In command prompt i had to remove the beginning and ending double quotes:

"C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf" --no-outline --page-size A4 --orientation Portrait --footer-right "Page [page] of [toPage]" --footer-spacing 3 C:\Windows\Temp\tmpDDC5.tmp.html C:\Windows\Temp\tmpDDD5.tmp

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 24, 2012

Owner

Where do the double quotes here come from: --footer-right "Page [page] of [toPage]"? Did you use it like this:

'footer-right' => '"Page [page] of [toPage]"', // note the extra " inside '

If so, then could you try without? The class should be "intelligent" and add all required quotes automatically.

I guess, you did the same for the bin option. Let's keep that for later. We should first find a good solution for the space problem.

Thanks again for your help.

Owner

mikehaertl commented Oct 24, 2012

Where do the double quotes here come from: --footer-right "Page [page] of [toPage]"? Did you use it like this:

'footer-right' => '"Page [page] of [toPage]"', // note the extra " inside '

If so, then could you try without? The class should be "intelligent" and add all required quotes automatically.

I guess, you did the same for the bin option. Let's keep that for later. We should first find a good solution for the space problem.

Thanks again for your help.

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 24, 2012

Yes, that is the way I am using it (this is what i tried mentioning in the very first comment). Even $bin has been similarly quoted.
Removing the quotes from either of them is not working.

The error is either:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
or:
Error: Failed loading page (sometimes it will work just to ignore this error with --load-error-handling ignore)

Including the load-error-handling option also does not work.

mohitp commented Oct 24, 2012

Yes, that is the way I am using it (this is what i tried mentioning in the very first comment). Even $bin has been similarly quoted.
Removing the quotes from either of them is not working.

The error is either:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
or:
Error: Failed loading page (sometimes it will work just to ignore this error with --load-error-handling ignore)

Including the load-error-handling option also does not work.

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 24, 2012

Owner

Ok. I still think, that it should work if you:

  • Keep 'bin' => '"C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf"' (including ")
  • Add the escape_shellarg() as stated above
  • Leave away any double quotes for your footer text

The comments from the PHP manual say, that escape_shellarg() will add the double quotes for you.

Maybe also try with/without extra " around your complete command, as you did in the first place.

Owner

mikehaertl commented Oct 24, 2012

Ok. I still think, that it should work if you:

  • Keep 'bin' => '"C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf"' (including ")
  • Add the escape_shellarg() as stated above
  • Leave away any double quotes for your footer text

The comments from the PHP manual say, that escape_shellarg() will add the double quotes for you.

Maybe also try with/without extra " around your complete command, as you did in the first place.

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 24, 2012

Have just tested with the following changes:

protected function getCommand($filename)
{
        $command = "\"$this->bin\"";
         ...
}

$out .= " --$key \"$val\"";

With these changes, there was obviously no need to add the extra quotes in either $bin, or header/footer parameters.

But the proc_open fix was still needed.
And using escapeshellarg did not work.

mohitp commented Oct 24, 2012

Have just tested with the following changes:

protected function getCommand($filename)
{
        $command = "\"$this->bin\"";
         ...
}

$out .= " --$key \"$val\"";

With these changes, there was obviously no need to add the extra quotes in either $bin, or header/footer parameters.

But the proc_open fix was still needed.
And using escapeshellarg did not work.

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 24, 2012

Owner

Ok, thanks for your help so far. I guess, i have to try it myself on a windows machine then to debug this a little more. As i said: I'm aiming for a solid solution that works for both, linux and windows. That's why i'm hesitating to add your proposed fix.

Let me know, if by chance you can make it work with escapeshellarg() somehow. I'm still pretty sure, that it must work with that.

If you still want to help debugging, you could modify your code again as i suggested 2 comments above and add a die($this->getCommand()) somewhere to see which command is really generated.

Owner

mikehaertl commented Oct 24, 2012

Ok, thanks for your help so far. I guess, i have to try it myself on a windows machine then to debug this a little more. As i said: I'm aiming for a solid solution that works for both, linux and windows. That's why i'm hesitating to add your proposed fix.

Let me know, if by chance you can make it work with escapeshellarg() somehow. I'm still pretty sure, that it must work with that.

If you still want to help debugging, you could modify your code again as i suggested 2 comments above and add a die($this->getCommand()) somewhere to see which command is really generated.

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 24, 2012

Found another link that has some additional info:
http://me.abelcheung.org/2009/01/19/windows-process-execution-on-php-with-double-quotes/

According to this link, the proc_open statement needs to be changed to:
proc_open($command, $descriptors, $pipes, null, null, array('bypass_shell'=>true))

This works. But as you said, a check for Linux is required.

escapeshellarg now produces the output. But the output which was fine earlier, has some escaped characters now. This could be due to some javascript code in the header/footer at my end.

mohitp commented Oct 24, 2012

Found another link that has some additional info:
http://me.abelcheung.org/2009/01/19/windows-process-execution-on-php-with-double-quotes/

According to this link, the proc_open statement needs to be changed to:
proc_open($command, $descriptors, $pipes, null, null, array('bypass_shell'=>true))

This works. But as you said, a check for Linux is required.

escapeshellarg now produces the output. But the output which was fine earlier, has some escaped characters now. This could be due to some javascript code in the header/footer at my end.

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 25, 2012

Owner

So you don't have to add double quotes to your bin path or your arguments anymore? If so, could you sum up what you had to change to make it work? I'll then give it a try on linux.

Owner

mikehaertl commented Oct 25, 2012

So you don't have to add double quotes to your bin path or your arguments anymore? If so, could you sum up what you had to change to make it work? I'll then give it a try on linux.

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 25, 2012

escapeshellarg() is replacing % inside the arguments to a blank space, which is causing difficulty in sending encoded url in header or footer.

To explain the situation, consider a situation where the user wants to pass a query parameter to the header html file. This query can contain special characters such as ', ", & etc. I am trying to use rawurlencode($header) to encode the query parameter. Lets assume a query parameter with special characters - De"f & Sons Ltd - in $header. Now i am trying to use:
'header-html'=>'header.html?cmp=' . rawurlencode($header)

This would produce the parameter as header.html?cmp=De%22f%20%26%20Sons%20Ltd

But if escapeshellarg() is used, the parameter becomes header.html?cmp=De 22f 20 26 20Sons 20Ltd

(rawurlencode() is used instead of urlencode() to overcome the '+' issue. Using urlencode() would also not produce the desired result)

This replacing of % with (space) also seems to be specific to Windows, as mentioned in some comments by Audun and egorinsk at gmail dot com in the escapeshellarg comments of PHP docs.

So, as of now, this is what is working for me:

protected $bin = 'C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf';   //no problem here, no need for using additional quotes
    protected function createPdf($fileName)
    {
        $command = $this->getCommand($fileName);

        // we use proc_open with pipes to fetch error output
        $descriptors = array(
            1   => array('pipe','w'),
            2   => array('pipe','w'),
        );
        $process = proc_open($command, $descriptors, $pipes, null, null, array('bypass_shell'=>true)); //this line is changed
        ...
}
    protected function renderOptions($options)
    {
        $out = '';
        foreach($options as $key=>$val)
            if(is_numeric($key))
                $out .= " --$val";
            else
                $out .= " --$key \"$val\"";   //this line is changed

        return $out;
    }

The headers/footers are passed with single quotes, as shown above.

mohitp commented Oct 25, 2012

escapeshellarg() is replacing % inside the arguments to a blank space, which is causing difficulty in sending encoded url in header or footer.

To explain the situation, consider a situation where the user wants to pass a query parameter to the header html file. This query can contain special characters such as ', ", & etc. I am trying to use rawurlencode($header) to encode the query parameter. Lets assume a query parameter with special characters - De"f & Sons Ltd - in $header. Now i am trying to use:
'header-html'=>'header.html?cmp=' . rawurlencode($header)

This would produce the parameter as header.html?cmp=De%22f%20%26%20Sons%20Ltd

But if escapeshellarg() is used, the parameter becomes header.html?cmp=De 22f 20 26 20Sons 20Ltd

(rawurlencode() is used instead of urlencode() to overcome the '+' issue. Using urlencode() would also not produce the desired result)

This replacing of % with (space) also seems to be specific to Windows, as mentioned in some comments by Audun and egorinsk at gmail dot com in the escapeshellarg comments of PHP docs.

So, as of now, this is what is working for me:

protected $bin = 'C:\Program Files (x86)\wkhtmltopdf\wkhtmltopdf';   //no problem here, no need for using additional quotes
    protected function createPdf($fileName)
    {
        $command = $this->getCommand($fileName);

        // we use proc_open with pipes to fetch error output
        $descriptors = array(
            1   => array('pipe','w'),
            2   => array('pipe','w'),
        );
        $process = proc_open($command, $descriptors, $pipes, null, null, array('bypass_shell'=>true)); //this line is changed
        ...
}
    protected function renderOptions($options)
    {
        $out = '';
        foreach($options as $key=>$val)
            if(is_numeric($key))
                $out .= " --$val";
            else
                $out .= " --$key \"$val\"";   //this line is changed

        return $out;
    }

The headers/footers are passed with single quotes, as shown above.

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 25, 2012

Owner

I see your point. But what happens if your header/footer contains " or ' ? Will your solution still work?

Owner

mikehaertl commented Oct 25, 2012

I see your point. But what happens if your header/footer contains " or ' ? Will your solution still work?

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 25, 2012

If you are meaning that the query parameters in the header or footer contains " or ', yes it is working.

mohitp commented Oct 25, 2012

If you are meaning that the query parameters in the header or footer contains " or ', yes it is working.

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 25, 2012

Owner

Well, not only the query: What if you want to display a ' or " in the header as text. For example

'header-html' => "It's a test with \"quotes\"."

Owner

mikehaertl commented Oct 25, 2012

Well, not only the query: What if you want to display a ' or " in the header as text. For example

'header-html' => "It's a test with \"quotes\"."

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 25, 2012

With the exact example that you have provided, the quotes around the string quote is not being output. The output received is pdf is
It's a test with quotes.

This would be due to the modification in the $out variable.

mohitp commented Oct 25, 2012

With the exact example that you have provided, the quotes around the string quote is not being output. The output received is pdf is
It's a test with quotes.

This would be due to the modification in the $out variable.

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 25, 2012

Owner

Ok, thanks. It seems there's no 100% solution for windows then. Either we break the % characters with escapeshellargs() or we loose some quote characters.

Maybe we can find a even better solution.

Owner

mikehaertl commented Oct 25, 2012

Ok, thanks. It seems there's no 100% solution for windows then. Either we break the % characters with escapeshellargs() or we loose some quote characters.

Maybe we can find a even better solution.

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 25, 2012

To get this example working, passing the parameter in either of these following manners is working:
'header-right' => 'It\'s a test with \"quotes\".'
'header-right' => "It's a test with '\"'quotes'\"'."

So the user would have to definitely make adjustments at his end. As he is mixing both the quotes in a single argument for a command line argument, such adjustments should be acceptable. Lot of times, even to use plain PHP, we have to do it. Example, for using backslash in preg_replace, it must be doubled to \\

mohitp commented Oct 25, 2012

To get this example working, passing the parameter in either of these following manners is working:
'header-right' => 'It\'s a test with \"quotes\".'
'header-right' => "It's a test with '\"'quotes'\"'."

So the user would have to definitely make adjustments at his end. As he is mixing both the quotes in a single argument for a command line argument, such adjustments should be acceptable. Lot of times, even to use plain PHP, we have to do it. Example, for using backslash in preg_replace, it must be doubled to \\

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 29, 2012

Owner

Ok, so here's my suggestion:

  • We add the bypass_shell option to proc_open. It's ignored on Linux.
  • We add a $enableShellEscaping=true; to the class. By default this will use escapeshellargs() on both, bin and other all options. You can set this to false for windows environments. Then it's up to you to find the right way to write your string.

If you agree and are willing to help testing, i would provide this in a test branch for you.

Owner

mikehaertl commented Oct 29, 2012

Ok, so here's my suggestion:

  • We add the bypass_shell option to proc_open. It's ignored on Linux.
  • We add a $enableShellEscaping=true; to the class. By default this will use escapeshellargs() on both, bin and other all options. You can set this to false for windows environments. Then it's up to you to find the right way to write your string.

If you agree and are willing to help testing, i would provide this in a test branch for you.

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 29, 2012

Yes, i can do that.

I think this could be a good solution. You can probably, then document this info, that if using in Windows and having $enableShellEscaping set to true, then the percentages need to replaced before the execution, and similarly, re-replaced in javascript.

mohitp commented Oct 29, 2012

Yes, i can do that.

I think this could be a good solution. You can probably, then document this info, that if using in Windows and having $enableShellEscaping set to true, then the percentages need to replaced before the execution, and similarly, re-replaced in javascript.

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 29, 2012

Owner

Just pushed the fix to master. Could you let me know if it works for you? As a reminder, you can use it like this:

<?php
    $pdf = new WkHtmlToPdf(array(
        'enableEscaping' => false,
        'bin' => '...',
    ));
Owner

mikehaertl commented Oct 29, 2012

Just pushed the fix to master. Could you let me know if it works for you? As a reminder, you can use it like this:

<?php
    $pdf = new WkHtmlToPdf(array(
        'enableEscaping' => false,
        'bin' => '...',
    ));
@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 30, 2012

The changes are fine. But you forgot to update the proc_open statement with the Windows bypass_shell solution.
I have made this change locally and without any other changes, the class works. (enableEscaping is set to true, i.e., in default mode, in my usage. And i am replacing % before creating the WkHtmlToPdf class and re-replacing it in Javascript.)

This solution works in Windows.

mohitp commented Oct 30, 2012

The changes are fine. But you forgot to update the proc_open statement with the Windows bypass_shell solution.
I have made this change locally and without any other changes, the class works. (enableEscaping is set to true, i.e., in default mode, in my usage. And i am replacing % before creating the WkHtmlToPdf class and re-replacing it in Javascript.)

This solution works in Windows.

mikehaertl added a commit that referenced this issue Oct 30, 2012

@mikehaertl

This comment has been minimized.

Show comment Hide comment
@mikehaertl

mikehaertl Oct 30, 2012

Owner

Oh, right. Sorry. I've also fixed this now. But to be really sure, that enableEscaping is useful, it would be really great if you could do another final test and set it to false and then try it with different special characters like % , " and '. I mean, that was the main idea behind it, right? :)

If everything is o.k., i'll release it as version 1.1.1.

Thanks again for all your help to improve this class!

Owner

mikehaertl commented Oct 30, 2012

Oh, right. Sorry. I've also fixed this now. But to be really sure, that enableEscaping is useful, it would be really great if you could do another final test and set it to false and then try it with different special characters like % , " and '. I mean, that was the main idea behind it, right? :)

If everything is o.k., i'll release it as version 1.1.1.

Thanks again for all your help to improve this class!

@mohitp

This comment has been minimized.

Show comment Hide comment
@mohitp

mohitp Oct 30, 2012

Setting it to true, the special characters " and % are replaced by a single space. ' is printed. Otherwise things work fine.

Examples:

'footer-right'  => "Page [page] of '[toPage]"     //ok. Ouput: Page 1 of '3
'footer-right'  => "Page [page] of \"[toPage]"    //Ouput: Page 1 of  3
'footer-right'  => 'Page [page] of "[toPage]'     //Ouput: Page 1 of  3
'footer-right'  => 'Page [page] of \"[toPage]'    //Ouput: Page 1 of \ 3
'footer-right'  => 'Page [page] of %[toPage]'     //Ouput: Page 1 of  3
'footer-right'  => "Page [page] of %[toPage]"    //Ouput: Page 1 of  3

mohitp commented Oct 30, 2012

Setting it to true, the special characters " and % are replaced by a single space. ' is printed. Otherwise things work fine.

Examples:

'footer-right'  => "Page [page] of '[toPage]"     //ok. Ouput: Page 1 of '3
'footer-right'  => "Page [page] of \"[toPage]"    //Ouput: Page 1 of  3
'footer-right'  => 'Page [page] of "[toPage]'     //Ouput: Page 1 of  3
'footer-right'  => 'Page [page] of \"[toPage]'    //Ouput: Page 1 of \ 3
'footer-right'  => 'Page [page] of %[toPage]'     //Ouput: Page 1 of  3
'footer-right'  => "Page [page] of %[toPage]"    //Ouput: Page 1 of  3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment