[solved] Search in CMSMS ver 1.5.2 generates incorrect action="" path
Posted: Thu Feb 12, 2009 7:18 am
I noticed the search module did not work on any interior pages. Attempting a search redirected to the originating page and did not process. It worked fine on the home page. I tried this on 3 different installs on 2 different servers using cms ver 1.5.2
The problem is the generated action="" path. On interior pages it becomes action="http://www.domain-name.com/page-alias/" and it should be action="http://www.domain-name.com/[b]index.php[/b]" regardless of the hierarchy.
The root of the problem is in this file:
/lib/classes/module_support/modform.inc.php
The new version (1.5.2) uses the current page's URL action="" . See line 35:
Solution that works for me (tested in 4 sites) is replacing line 35 with PHP_SELF
I haven't tested in a SSL environment, but I think the complete solution is Replacing this:
With:
I submitted a bug ticket here: http://dev.cmsmadesimple.org/bug/view/3021
.
The problem is the generated action="" path. On interior pages it becomes action="http://www.domain-name.com/page-alias/" and it should be action="http://www.domain-name.com/[b]index.php[/b]" regardless of the hierarchy.
The root of the problem is in this file:
/lib/classes/module_support/modform.inc.php
The new version (1.5.2) uses the current page's URL action="" . See line 35:
Code: Select all
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
Code: Select all
$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER['PHP_SELF'];
Code: Select all
function __curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
Code: Select all
function __curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"] .":".$_SERVER["SERVER_PORT"]. $_SERVER["PHP_SELF"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER['PHP_SELF'];
}
return $pageURL;
}
I submitted a bug ticket here: http://dev.cmsmadesimple.org/bug/view/3021
.