Re: [extension release] Domain.PunBB
Smartys, how about this version? Without not PunBB style html in manager, shorts tags and bug with quick jump.
SuperMAG, upload to punres and update first post.
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.3 extensions → [extension release] Domain.PunBB
Smartys, how about this version? Without not PunBB style html in manager, shorts tags and bug with quick jump.
SuperMAG, upload to punres and update first post.
Splitting up PHP handling from the other filetypes was smart, although if you want to avoid the redirect, you can just use file_get_contents and echo the contents out.
Also, I still think the "use .htaccess to redirect all requests to the right file" idea is better, I just don't know how easy it is.
You still need to properly deal with null bytes.
In extensions/domain/admin.php, your file writing allows the person to write to an arbitrary file. They can also delete arbitrary files. You should never allow raw, unchecked data from the user to be used in picking a file.
This:
foreach (glob($dirname.'/*.php') as $file){
$pun_domain_old = $pun_domain;
include $file;
$domains[] = array(
'id' => substr(basename($file), 0, -4),
'base_url' => $pun_domain['base_url'],
'category' => explode(',', $pun_domain['category'])
);
$pun_domain = $pun_domain_old;
unset($pun_domain_old);
}
can be simply written as
$real_pun_domain = $pun_domain;
foreach (glob($dirname.'/*.php') as $file)
{
include $file;
$domains[] = array(
'id' => substr(basename($file), 0, -4),
'base_url' => $pun_domain['base_url'],
'category' => explode(',', $pun_domain['category'])
);
}
$pun_domain = $real_pun_domain;
unset($real_pun_domain);
Yes, just .htaccess file better idea, but i try make rewrite rule and loose.
Sorry, about null bytes i dont understand you 100%. First time i think null butes you mean empty... Now i think about \xNN in URL or something. No?
Not check POST data it sketch. For full work need see PunBB code more.
About $real_pun_domain you right. Why i put it in loop i dont know. %)
Null byte: \0
If I put that in my input, PHP (at least for file operations) interprets the string as ending at the null byte.
PunBB Forums → PunBB 1.3 extensions → [extension release] Domain.PunBB
Powered by PunBB, supported by Informer Technologies, Inc.