[patch] HTML character entry for alternate post/page content
-
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;
after:
$sUamPostContent = $oPost->post_content[0] . " " . stripslashes($sUamPostContent);
2. UserAccessManager.class.php:1441 before:
$oPost->post_content = $sUamPostContent;
after:
$oPost->post_content = stripslashes($sUamPostContent);
3. adminSettings.php:141 before:
echo apply_filters('format_to_edit', ($aUamOptions['post_content']);
after:
echo apply_filters('format_to_edit', stripslashes($aUamOptions['post_content']) );
4. adminSettings.php:262 before:
echo apply_filters('format_to_edit', $aUamOptions['page_content']);
after:
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:
- The plugin add “\\\\\” caracter in Text fields in Parameters
- Quotes are escaped in UAM Options (e.g. content and title)
- Can’t add quotes to “Post content” & “Post content” body
- Not possible to link to pages in options dialogue
- Links on Page settings not working
- problem with HTML Code in Post content Box
- Broken HTML handling
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.
- The topic ‘[patch] HTML character entry for alternate post/page content’ is closed to new replies.