Ticket #114 (closed defect: fixed)
$config[embedded] = 1 even when just running Plogger not embedded in anything.
| Reported by: | mwaldtha@… | Owned by: | kasper |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0 |
| Component: | General | Version: | 1.0b3 |
| Severity: | normal | Keywords: | embedded |
| Cc: | mwaldtha@…, derek@… |
Description
I'm working with the beta 3 files, and I noticed that the <title> element was not being written to the <head> element, so I went to find out why. After a short search I found that in the plog-load_config.php file the following 'if' statement is being evaluated to true, and thus $config[embedded] is being set to 1, as if Plogger was being run embedded instead of standalone:
if (dirname(__FILE__) != dirname(realpath($_SERVER["PATH_TRANSLATED"])) && strpos($_SERVER["PATH_TRANSLATED"],"admin") === false) {
$config["embedded"] = 1;
// disable our own cruft-free urls, because the URL has already been processed
// by WordPress
$config["use_mod_rewrite"] = 0;
} else {
$config["baseurl"] = "http://".$_SERVER["SERVER_NAME"]. substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")) . "/";
};
If I change the last conditional test from 'false' to 'true', the else branch is executed and the <title> element is written to the <head> element, and the cruft-free urls are generated (if turned on from the admin area). I'm sure this is not the propper fix, but I tested it to make sure it worked in my environment. The values being used for the 'if' statement in my environment are as follows:
dirname(__FILE__) = "/www/t/thespokenwhe/htdocs/pb3" dirname(realpath($_SERVER["PATH_TRANSLATED"])) = "/www/t/thespokenwhe/htdocs" strpos($_SERVER["PATH_TRANSLATED"],"admin") = ""
If you need any more information or would like for me to test a fix please let me know. :-)
