Hiding content with OpenCrypt

If you’re using a WordPress website (such as www.digi-pole.com) and provide secure member content using the build system called ‘OpenCrypt‘, then whenever WordPress is updated, the modifications to the source code gets overwritted, and the hidden text is no longer hidden (although items stored in the secure members area is still secure).

The file you need to update is:

/wp-includes/post-template.php

Around line 302, you should see something along the lines of:

    if ( $preview ) // Preview fix for JavaScript bug with foreign languages.
        $output =    preg_replace_callback( ‘/\%u([0-9A-F]{4})/’, ‘_convert_urlencoded_to_entities’, $output );

    return $output;
}

This needs to be changed as follows (with the additions in red)

    if ( $preview ) // Preview fix for JavaScript bug with foreign languages.
        $output =    preg_replace_callback( ‘/\%u([0-9A-F]{4})/’, ‘_convert_urlencoded_to_entities’, $output );

   # OpenCrypt Modification
    require “opencrypt_plugin.php”;
    # OpenCrypt Modification

return $output;
}