Fork me on GitHub

PageLock return address  Bottom

  • Hello,
    I am trying to use Pagelock with a return address set like in the documentation.

    Code

    $returnUrl = pnModUrl('yourmodule', 'user', 'view');

    pnModAPIFunc('PageLock', 'user', 'pageLock',
                  array('lockName' => "yourmodule{$mid}",
                        'returnUrl' => $returnUrl));

    But when a page is locked and I click on the "Back" button, the return address is not written correctly. The function converts special chars into entities name, in example it gives me the address : http://yoursite.com/index.php?module=yourmodule&type=user&func=view

    So is it a bug ? or something I do wrong ?
    Thanks for your help,
    Philippe
  • The pnRender plugin version of pnModURL does that encoding for use in templates (it must be encoded in tags in order to validate). Maybe the core pnModUrl does so too - I don't exactly know where the encoding takes place.
  • Please try to change line 23 of system/PageLock/pnuserapi.php
    from

    Code

    $returnUrl = (array_key_exists('returnUrl', $args) ? htmlspecialchars($args['returnUrl']) : null);

    to

    Code

    $returnUrl = (array_key_exists('returnUrl', $args) ? $args['returnUrl'] : null);


    --
    Guite | ModuleStudio
  • OK, it works great without "htmlspecialchars".
    Thanks again,
    Philippe
  • I created ticket #1012 for reference.

    --
    Guite | ModuleStudio
  • 0 users

This list is based on users active over the last 60 minutes.