Skip to content

Commit dca1ccd

Browse files
committed
Merge pull request #3 from CleanTalk/2.0beta
2 0beta
2 parents e360554 + d91f40e commit dca1ccd

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

cleantalk.class.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,4 +1059,30 @@ function sendRawRequest($url,$data,$isJSON=false,$timeout=3)
10591059
return $result;
10601060
}
10611061

1062+
if( !function_exists('apache_request_headers') )
1063+
{
1064+
1065+
function apache_request_headers()
1066+
{
1067+
$arh = array();
1068+
$rx_http = '/\AHTTP_/';
1069+
foreach($_SERVER as $key => $val)
1070+
{
1071+
if( preg_match($rx_http, $key) )
1072+
{
1073+
$arh_key = preg_replace($rx_http, '', $key);
1074+
$rx_matches = array();
1075+
$rx_matches = explode('_', $arh_key);
1076+
if( count($rx_matches) > 0 and strlen($arh_key) > 2 )
1077+
{
1078+
foreach($rx_matches as $ak_key => $ak_val) $rx_matches[$ak_key] = ucfirst($ak_val);
1079+
$arh_key = implode('-', $rx_matches);
1080+
}
1081+
$arh[$arh_key] = $val;
1082+
}
1083+
}
1084+
return( $arh );
1085+
}
1086+
}
1087+
10621088
?>

0 commit comments

Comments
 (0)