Commit 0086402e authored by Claudemir Todo Bom's avatar Claudemir Todo Bom

* remove function duplicates

parent 65b9801b
<?php
<?php
require_once "wwmail.inc.php";
$raw = file_get_contents('php://input');
$matches = array();
preg_match('/<EMailAddress>(.*)<\/EMailAddress>/', $raw, $matches);
header('Content-Type: application/xml');
function file_read_without_comments($filepath) {
$string='';
$file=fopen($filepath,'r');
while (($line = fgets($file)) !== false) {
if (trim($line)[0] != "#") {
$string.=trim($line)."\n";
}
}
fclose($file);
return $string;
}
$config = parse_ini_string(file_read_without_comments("/etc/default/wwmail"));
$xml="<?xml version='1.0' encoding='utf-8' ?>
......
<?php
<?php
header('Content-Type: text/xml');
function file_read_without_comments($filepath) {
$string='';
$file=fopen($filepath,'r');
while (($line = fgets($file)) !== false) {
if (trim($line)[0] != "#") {
$string.=trim($line)."\n";
}
}
fclose($file);
return $string;
}
require_once "wwmail.inc.php";
$config = parse_ini_string(file_read_without_comments("/etc/default/wwmail"));
......
<?php
function base64url_encode($data) {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
function base64url_decode($data) {
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
function file_read_without_comments($filepath) {
$string='';
$file=fopen($filepath,'r');
while (($line = fgets($file)) !== false) {
if (trim($line)[0] != "#") {
$string.=trim($line)."\n";
}
}
fclose($file);
return $string;
}
require_once "wwmail.inc.php";
$htmlhead=
"<html>
......
<?php
function base64url_encode($data) {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
function base64url_decode($data) {
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
function file_read_without_comments($filepath) {
$string='';
$file=fopen($filepath,'r');
while (($line = fgets($file)) !== false) {
if (trim($line)[0] != "#") {
$string.=trim($line)."\n";
}
}
fclose($file);
return $string;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment