You are here: what does this code block do? « All PHP « IT news, forums, messages
what does this code block do?

Posted by starman7 on 03/18/07 14:13

i'm installing a custom php bulletin board, the below code complains
about its configuration file having spaces or carriage feeds before or
after the beginning or end of the code. as far as i could tell the
above code evaluated for reasons other that that ... as my config.php
had no spaces, etc. and worked completely after removal of this block,
and even partially while the block remained - (but displayed the
error).

can anyone describe what this code does, and advise if removing it
makes the app any less secure? i removed it and everything worked as
expected. and/or suggest replacement code i can suggest to the author?
also - why is it looking at dbuser?


$config_content = @file_get_contents($phpbb_root_path . 'config.'.
$phpEx);

if ( strpos($config_content, 'dbuser') && (substr($config_content, 0,
5) != '<?php' || substr($config_content, -2) != '?>') )
{
print('· You have <u>damaged</u>: <b>config.'.$phpEx.'</b> file !<br /
>· File must begin with: <b>&lt;?php</b> and finish with <b>?&gt;</b>
with any other chars (spaces, tabs or new line) before &lt;?php and
after ?&gt;<br />· You must correct the file !<br />· Remember <u>it
is not mistake</u>, if your text editor can not see this space, tab or
new line, use other editor with operating multi (CR/LF) format or
create new file with clean content.<br />· Forum will not work
correctly with damaged config.php file.<hr /><br />');
}


thanks,
s7

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация