Fix the ISC File Include Bug

Background

From ISC doc:

It’s also possible to include another file within a template. This can be accomplished using file include variables. This is extremely useful if external files such as banners, site‐network headers or other content need to be included. File includes can either be local (relative to the Interspire Shopping Cart base directory), contain absolute file system paths, or be remote includes by specifying the full URL to a file to be included.

Problem

The local file include is not working due to a coding bug in /public_html/lib/templates/template.php

Solution

//$includeRoot = ISC_BASE_PATH . '/templates/__includes/';
$includeRoot = ISC_BASE_PATH . '/';

Now we can include any local files in templates

2 Replies to “Fix the ISC File Include Bug”

  1. That’s actually not a bug but a deliberate feature. The original path limitation meant that someone could not accidentally or otherwise include a file such as config.foo and spill the secrets.
    By all means use but be careful to check you don’t “overshare” 😉

    1. Yes, you are correct. But the original code is not working either, because the actual file check logic does not include the template include directory.

      Based on your feedback, I have added the logic to check and include “.TXT” file only. I can share it with you via email 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *