diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-12-20 22:09:14 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-12-20 22:09:14 +0000 |
commit | 9a706a57ba6888eea230c79064c099c4c59b514d (patch) | |
tree | 14cb6081a6909e77c901e4bd3e4bb03ca4a5291b /usr | |
parent | d92375afa54a130b6122859db98e84bb3d29486a (diff) | |
download | pfsense-9a706a57ba6888eea230c79064c099c4c59b514d.zip pfsense-9a706a57ba6888eea230c79064c099c4c59b514d.tar.gz |
* Use file_get_contents()
* Use str_replace()
* Use correct variables
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/system_advanced_create_certs.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/usr/local/www/system_advanced_create_certs.php b/usr/local/www/system_advanced_create_certs.php index 9b79456..c4bc7dd 100755 --- a/usr/local/www/system_advanced_create_certs.php +++ b/usr/local/www/system_advanced_create_certs.php @@ -154,16 +154,12 @@ include("head.inc"); <p>One moment please... <?php mwexec("cd /tmp/ && /usr/bin/openssl req -new -x509 -keyout /tmp/cakey.pem -out /tmp/cacert.pem -days 3650 -config /var/etc/ssl/openssl.cnf -passin pass:test -nodes"); - $fd = fopen("/tmp/cacert.pem", "r"); - $cacert = fread($fd,8096); - fclose($fd); - $fd = fopen("/tmp/cakey.pem", "r"); - $cakey = fread($fd,8096); - fclose($fd); - $cacertA = ereg_replace("\r","",$cacert); - $cakeyA = ereg_replace("\r","",$cakey); - $cacert = ereg_replace("\n","\\n",$cacert); - $cakey = ereg_replace("\n","\\n",$cakey); + $cacert1 = file_get_contents("/tmp/cacert.pem"); + $cakey1 = file_get_contents("/tmp/cakey.pem"); + $cacertA = str_replace("\r","",$cacert1); + $cakeyA = str_replace("\r","",$cakey1); + $cacert = str_replace("\n","\\n",$cacertA); + $cakey = str_replace("\n","\\n",$cakeyA); ?> <script language="JavaScript"> <!-- |