admin
Karma: 98
|
Re:download in front-end leads to blank page - 2010/02/19 10:51
This looks to be a fault in PHP 5.2.12 so far as I can see. The following details the problem as seen at one particular site:
As installed on your site, PHP is failing on the get_defined_constants function when the optional boolean parameter is set to true. What should happen is that the function returns an array of arrays, with the top level splitting the types of symbol definition between user and system. This has worked with other PHP releases, but appears to fail, at least in your environment. It should be reported as a PHP bug, but I cannot do that because it may involve questions about your hosting environment. I have created the simple test file symtest.php as shown below. You can invoke it by going to http://www.*****.***/symtest.php where you will see that PHP fails (indicated by the apparent download of the PHP script). I have also fixed Remository by not using the categorize option, although this is much less efficient. But there seems no alternative while PHP behaves this way. I will also post this in the forum, with details of the fix I have applied.
| Code: |
<?php
define ('MY_SYMBOL', 'Something or other');
$test = get_defined_constants(true);
var_dump($test);
|
The workaround is to modify the file ~/components/com_remository/remository.html.php at around lines 463 to 466 where you should find:
| Code: |
protected function translateDefinitions ($string) {
$translators = get_defined_constants(true);
return str_replace(array_keys($translators['user']), array_values($translators['user']), $string);
}
|
Change it to:
| Code: |
protected function translateDefinitions ($string) {
$translators = get_defined_constants();
return str_replace(array_keys($translators), array_values($translators), $string);
}
|
Martin Brampton aka Counterpoint http://aliro.org http://black-sheep-research.com |