User Access Manager
[patch] HTML character entry for alternate post/page content (3 posts)

  1. Eric McNiece
    Posted 2 years ago #

    It is possible to fix the addslashes() problem present when entering escapable characters in the alternate post and page content areas within the UAM settings page. To do so, 4 locations must be modified (as of v1.2.4.3):

    • /user-access-manager/class/UserAccessManager.class.php: Line 1438
    • /user-access-manager/class/UserAccessManager.class.php: Line 1441
    • /user-access-manager/tpl/adminSettings.php: Line 141
    • /user-access-manager/tpl/adminSettings.php: Line 262

    UserAccessManager.class.php deals with the theme-side output of the HTML content, while adminSettings.php prints the admin settings page. Both locations must be adjusted to remove slashes so that you can save AND display your content properly.

    1. UserAccessManager.class.php:1438 before:
    $sUamPostContent = $oPost->post_content[0] . " " . $sUamPostContent;

    $sUamPostContent = $oPost->post_content[0] . " " . stripslashes($sUamPostContent);

    2. UserAccessManager.class.php:1441 before:
    $oPost->post_content = $sUamPostContent;

    $oPost->post_content = stripslashes($sUamPostContent);

    3. adminSettings.php:141 before:
    echo apply_filters('format_to_edit', ($aUamOptions['post_content']);

    echo apply_filters('format_to_edit', stripslashes($aUamOptions['post_content']) );

    4. adminSettings.php:262 before:
    echo apply_filters('format_to_edit', $aUamOptions['page_content']);

    echo apply_filters('format_to_edit', stripslashes($aUamOptions['page_content']) );

    These changes have been made to the following files so that you can copy-paste or completely replace your files if needed:

    The following support queue issues are related:

    And of course, special thanks to user gabrielinux and his post for actually tracking down part of the issue.

    Good luck! @GM_Alex... thanks for patching this when you get a chance ;)

    EDIT: I now realize that there may be more locations in which the HTML might be outputting to the theme... need to confirm.


  2. Eric McNiece
    Posted 1 year ago #

    @GM_Alex - any chance we can get a timeline for a fix for this? Low-hanging fruit for at least 7 support forum issues...

  3. Eric McNiece
    Posted 1 year ago #

    For Version:

    • /user-access-manager/class/UserAccessManager.class.php: Line 1533
    • /user-access-manager/class/UserAccessManager.class.php: Line 1536
    • /user-access-manager/tpl/adminSettings.php: Line 141
    • /user-access-manager/tpl/adminSettings.php: Line 262


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Access Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic