Changeset 3054 for trunk


Ignore:
Timestamp:
07/15/10 15:42:58 (14 years ago)
Author:
viani
Message:

Ticket #1143 - Redeclarar a função apache_request_headers quando não existir

Location:
trunk/workflow
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/doc/change_log.txt

    r3000 r3054  
    2222[2.2.000] 
    2323 
     24        #1143 - Refinição da função apache_request_headers, caso não exista no ambiente apache-php (viani) 
     25        #1139 - Modificação na função wf_upload_file para possibilitar a remoção de arquivos (fabianok) 
    2426        #1131 - Modificação na exportação de processos para permitir templates com nomes aleatórios (viani) 
    2527        #1120 - Moficado plugin wf_select_ldap_users para retornar atributos adicionais (adeildosantos) 
  • trunk/workflow/inc/common_functions.inc.php

    r2953 r3054  
    99*  option) any later version.                                              * 
    1010\**************************************************************************/ 
     11 
     12 
     13/** 
     14 * Redefines the apache_request_headers function if it was not done before by a phpmodule 
     15 * This usually happens if php runs as cgi 
     16 * @return array HTTP info presents in $_SERVER array 
     17 * @package Workflow 
     18 * @access public 
     19 */ 
     20if( !function_exists('apache_request_headers') ) { 
     21        /// 
     22        function apache_request_headers() { 
     23                $arh = array(); 
     24                $rx_http = '/\AHTTP_/'; 
     25                foreach($_SERVER as $key => $val) { 
     26                        if( preg_match($rx_http, $key) ) { 
     27                                $arh_key = preg_replace($rx_http, '', $key); 
     28                                $rx_matches = array(); 
     29                                // do some nasty string manipulations to restore the original letter case 
     30                                // this should work in most cases 
     31                                $rx_matches = explode('_', $arh_key); 
     32                                if( count($rx_matches) > 0 and strlen($arh_key) > 2 ) { 
     33                                        foreach($rx_matches as $ak_key => $ak_val) $rx_matches[$ak_key] = ucfirst($ak_val); 
     34                                        $arh_key = implode('-', $rx_matches); 
     35                                } 
     36                                $arh[$arh_key] = $val; 
     37                        } 
     38                } 
     39                return( $arh ); 
     40        } 
     41        /// 
     42} 
    1143 
    1244/** 
Note: See TracChangeset for help on using the changeset viewer.