I try this code:
Code: Select all
{PHP:http://www.gabriellagramegna.it/index.php?id=1,5,0,0,1,0}
Code: Select all
{PHP:http://www.gabriellagramegna.it/index.php?id=1,5,0,0,1,0}
Code: Select all
function include_ext_php($inc_file, $t=0) {
// includes an external PHP script file and returns
// the result as string from buffered include content
$ext_php_content = '';
//check if this is a local file
if(is_file($inc_file)) {
if(!$t) {
$this_path = str_replace("\\", '/', dirname(realpath($inc_file)));
$this_path = preg_replace('/\/$/', '', $this_path);
$root_path = str_replace("\\", '/', PHPWCMS_ROOT);
$root_path = preg_replace('/\/$/', '', $root_path);
if(strpos($this_path, $root_path) === 0) $t = 1;
}
} else {
if(!$t) {
//if remote URL is allowed in conf.inc.php
if(intval($GLOBALS['phpwcms']['allow_remote_URL'])) $t =1;
}
}
if($t) {
ob_start();
include($inc_file);
$ext_php_content = ob_get_contents();
ob_end_clean();
}
return $ext_php_content;
}
Code: Select all
$phpwcms["allow_remote_URL"] = 0; //0 = no remote URL in {PHP:...} replacement tag allowed, 1 = allowed
You intend to say to put something like this in the search form?Oliver Georgi wrote:I have patched phpwcms for the new value in conf.inc.php - but test it. It might be unsecure when somebody is able to inject your install via search form field. Please test!!!
Oliver
Code: Select all
http://www.gabriellagramegna.it/setup/setup.php
Code: Select all
SELECT * FROM `phpwcms_user` WHERE usr_login='mylogin'
Code: Select all
{PHP:http://www.mysite.com/myinjection.php}
This does not work... Maybe I don't this understand...Oliver Georgi wrote:This does not work anymore because of security problems. But you can use something like this by creating a new php script like "myextpage.php":
<?php
//include remote URL
include ('http://www.gabriellagramegna.it/index.p ... ,5,0,0,1,0');
?>
Then use the replacement tag {PHP:myextpage.php}.
Maybe I should implement a new config var that allows remote URL based on user's choice.
Oliver
Code: Select all
<?php
//include remote URL
include ('http://info.cms.to.pl/index.php?id=1,1,0,0,1,0');
?>
Code: Select all
{NAV_TABLE_SIMPLE}<br><br>
{PHP:newsy.php}
Code: Select all
Warning: main(http://info.cms.to.pl/index.php?id=1,1,0,0,1,0): failed to open stream: HTTP request failed! D_FâŠ1$[7FZ7F in /home/dealer/main/pkg/cms/info/html/newsy.php on line 3
Warning: main(): Failed opening 'http://info.cms.to.pl/index.php?id=1,1,0,0,1,0' for inclusion (include_path='.:/usr/lib/php') in /home/dealer/main/pkg/cms/info/html/newsy.php on line 3
Code: Select all
$phpwcms["allow_remote_URL"] = 1; //0 = no remote URL in {PHP:...} replacement tag allowed, 1 = allowed
Code: Select all
{NAV_TABLE_SIMPLE}<br><br>
{PHP:newsy.php}
Code: Select all
{NAV_TABLE_SIMPLE}<br><br>
{PHP:http://info.cms.to.pl/index.php?id=1,1,0,0,1,0}
Code: Select all
$phpwcms["allow_remote_URL"] = 1;