Exemple #1
0
function base64Decode($encoded_string)
{
    $MyBase64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    $in_len = strlen($encoded_string);
    $i = 0;
    $j = 0;
    $in_ = 0;
    $char_array_4 = array();
    $char_array_3 = array();
    $ret = '';
    while ($in_len-- && $encoded_string[$in_] != '=' && isBase64($encoded_string[$in_])) {
        $char_array_4[$i++] = $encoded_string[$in_];
        $in_++;
        if ($i == 4) {
            for ($i = 0; $i < 4; $i++) {
                $char_array_4[$i] = strpos($MyBase64_chars, $char_array_4[$i]);
            }
            $char_array_3[0] = ($char_array_4[0] << 2) + (($char_array_4[1] & 0x30) >> 4);
            $char_array_3[1] = (($char_array_4[1] & 0xf) << 4) + (($char_array_4[2] & 0x3c) >> 2);
            $char_array_3[2] = (($char_array_4[2] & 0x3) << 6) + $char_array_4[3];
            for ($i = 0; $i < 3; $i++) {
                $ret .= chr($char_array_3[$i]);
            }
            $i = 0;
        }
    }
    if ($i) {
        for ($j = $i; $j < 4; $j++) {
            $char_array_4[$j] = 0;
        }
        for ($j = 0; $j < 4; $j++) {
            $char_array_4[$j] = strpos($MyBase64_chars, $char_array_4[$j]);
        }
        $char_array_3[0] = ($char_array_4[0] << 2) + (($char_array_4[1] & 0x30) >> 4);
        $char_array_3[1] = (($char_array_4[1] & 0xf) << 4) + (($char_array_4[2] & 0x3c) >> 2);
        $char_array_3[2] = (($char_array_4[2] & 0x3) << 6) + $char_array_4[3];
        for ($j = 0; $j < $i - 1; $j++) {
            $ret .= chr($char_array_3[$j]);
        }
    }
    return $ret;
}
Exemple #2
0
<?php

ini_set('date.timezone', 'Asia/Shanghai');
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
// display warnings and errors
error_reporting(E_WARNING | E_ERROR);
@set_time_limit(120000);
//header("Content-Type: text/html; charset=GBK") ;
$isBase64 = isBase64();
//½øÐÐ_GET±äÁ¿×ª»»
$isBase64 == 1 ? CheckBase64() : '';
$SERVER_NAME = $_SERVER['SERVER_NAME'];
require_once '../adodb/adodb.inc.php';
require_once '../config.inc.php';
require_once '../setting.inc.php';
require_once '../Enginee/lib/function_system.php';
###############################################################################
//½ÏÑéÓû§ÐÅÏ¢ÊÇ·ñÌîдÍê³É
###############################################################################
$sql = "select * from unit limit 1";
$rs = $db->Execute($sql);
$rs_a = $rs->GetArray();
if ($rs_a[0]['UNIT_NAME'] == "") {
    page_css("ÇëÄúÏÈÍêÉƺÃÄãµÄÐÅÏ¢");
    $text = "ÔÚ½øÐÐϵͳÉý¼¶²Ù×÷֮ǰ,ÇëÄúÏȵ½µ¥Î»¹ÜÀíÖÐÍêÉƵ¥Î»ÐÅÏ¢";
    print "\n<table width='550'  border='0' align='center' cellpadding='0' cellspacing='0' class='small' style='border:1px solid #006699;'>\n<tr>\n<td height='30' align='middle' colspan=2  bgcolor='#E0F2FC'>\n<font color=red >ÔÚ½øÐÐϵͳÉý¼¶²Ù×÷֮ǰ,ÇëÄúÏÈÍêÉƺÃÄãµÄÐÅÏ¢</font>\n</td>\n</tr>\n<tr>\n<td align='center' colspan=2  bgcolor='#E0F2FC'>\n{$text}<BR>\n<BR><input type=button class=SmallButton maxsize=200 onClick=\"location='../../system/unit/'\" value='µã»÷½øÈ뵥λÐÅÏ¢¹ÜÀíÒ³Ãæ'>\n<BR>\n<BR>\n</td>\n</tr>\n<tr></table><BR>\n";
    print "";
    exit;
}
###############################################################################
 /**
  * SOAP::Value::_getSoapType
  *
  * convert php type to soap type
  * @param    string  value
  * @param    string  type  - presumed php type
  *
  * @return   string  type  - soap type
  * @access   private
  */
 function _getSoapType(&$value, &$type)
 {
     $doconvert = FALSE;
     if (0 && $this->wsdl) {
         # see if it's a complex type so we can deal properly with SOAPENC:arrayType
         if (!$type && $this->name) {
             # XXX TODO:
             # look up the name in the wsdl and validate the type
             $this->debug("SOAP_VALUE no type for {$this->name}!");
         } else {
             if ($type) {
                 # XXX TODO:
                 # this code currently handles only one way of encoding array types in wsdl
                 # need to do a generalized function to figure out complex types
                 if (array_key_exists($type, $this->wsdl->complexTypes)) {
                     if ($this->arrayType = $this->wsdl->complexTypes[$type]['arrayType']) {
                         $type = 'Array';
                     } else {
                         if ($this->wsdl->complexTypes[$type]['order'] == 'sequence' && array_key_exists('elements', $this->wsdl->complexTypes[$type])) {
                             reset($this->wsdl->complexTypes[$type]['elements']);
                             # assume an array
                             if (count($this->wsdl->complexTypes[$type]['elements']) == 1) {
                                 $arg = current($this->wsdl->complexTypes[$type]['elements']);
                                 $this->arrayType = $arg['type'];
                                 $type = 'Array';
                             } else {
                                 foreach ($this->wsdl->complexTypes[$type]['elements'] as $element) {
                                     if ($element['name'] == $type) {
                                         $this->arrayType = $element['type'];
                                         $type = $element['type'];
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     if (!$type || !$this->verifyType($type)) {
         if ($type && $this->wsdl && array_key_exists($type, $this->wsdl->complexTypes)) {
             # do nothing, this preserves our complex types
         } else {
             if (is_object($value)) {
                 # allows for creating special classes to handle soap types
                 $type = get_class($value);
                 # this may return a different type that we process below
                 $value = $value->toSOAP();
             } elseif (isArray($value)) {
                 $type = isHash($value) ? 'Struct' : 'Array';
             } elseif (isInt($value)) {
                 $type = 'int';
             } elseif (isFloat($value)) {
                 $type = 'float';
             } elseif (SOAP_Type_hexBinary::is_hexbin($value)) {
                 $type = 'hexBinary';
             } elseif (isBase64($value)) {
                 $type = 'base64Binary';
             } elseif (isBoolean($value)) {
                 $type = 'boolean';
             } else {
                 $type = gettype($value);
                 # php defaults a lot of stuff to string, if we have no
                 # idea what the type realy is, we have to try to figure it out
                 # this is the best we can do if the user did not use the SOAP_Value class
                 if ($type == 'string') {
                     $doconvert = TRUE;
                 }
             }
         }
     }
     # we have the type, handle any value munging we need
     if ($doconvert) {
         $dt = new SOAP_Type_dateTime($value);
         if ($dt->toUnixtime() != -1) {
             $type = 'dateTime';
             $value = $dt->toSOAP();
         }
     } else {
         if ($type == 'dateTime') {
             # encode a dateTime to ISOE
             $dt = new SOAP_Type_dateTime($value);
             $value = $dt->toSOAP();
         } else {
             // php type name mangle
             if ($type == 'integer') {
                 $type = 'int';
             } else {
                 if ($type == 'boolean') {
                     if ($value != 0 && $value != '0' || strcasecmp($value, 'true') == 0) {
                         $value = 'true';
                     } else {
                         $value = 'false';
                     }
                 }
             }
         }
     }
     return $type;
 }
Exemple #4
0
<?php

$type = $_GET['type'];
$timeout = $_GET['timeout'];
$viewport = $_GET['viewport'];
$js = $_GET['js'];
$resizewidth = $_GET['width'];
$cache = preg_replace("/[^A-Za-z0-9 ]/", '', $_GET['cache']);
$onfail = rawurldecode($_GET['onfail']);
if (!$onfail) {
    $onfail = 'https://http2pic.haschek.at/img/failed.jpg';
}
$url = rawurldecode($_GET['url']);
if (isBase64($url)) {
    $url = base64_decode($url);
}
if (!$timeout || !is_numeric($timeout) || ($timeout > 30 || $timeout < 1)) {
    $timeout = 10;
}
if ($viewport) {
    $a = explode('x', $viewport);
    $w = $a[0];
    $h = $a[1];
    if ($w) {
        $vp = "--width {$w} ";
    }
    if ($h) {
        $vp .= "--height {$h} ";
    }
}
if ($js == 'no') {
Exemple #5
0
function CheckBase64()
{
    global $_GET, $_SERVER;
    $QUERY_STRING = $_SERVER['QUERY_STRING'];
    $QUERY_STRING_ARRAY = explode('&', $QUERY_STRING);
    $QUERY_STRING = $QUERY_STRING_ARRAY[0];
    $QUERY_STRING = base64_decode($QUERY_STRING);
    $Array = explode('&', $QUERY_STRING);
    $_GET = array();
    //print_R($Array);
    //形成新的_GET变量信息
    $NewArray = array();
    for ($i = 0; $i < sizeof($Array); $i++) {
        if (isBase64($Array[$i]) == 1 && $i == 0) {
            $QUERY_STRING2 = base64_decode($Array[$i]);
            //print $QUERY_STRING2;
            $Array2 = explode('&', $QUERY_STRING2);
            //print_R($Array2);
            for ($i2 = 0; $i2 < sizeof($Array2); $i2++) {
                if ($Array2[$i2] != "") {
                    $ElementArray = explode('=', $Array2[$i2]);
                    $_GET[(string) $ElementArray[0]] = $ElementArray[1];
                    $_REQUEST[(string) $ElementArray[0]] = $ElementArray[1];
                    $NewArray[(string) $ElementArray[0]] = $ElementArray[0] . "=" . $ElementArray[1];
                }
            }
        } elseif ($Array[$i] != "") {
            $ElementArray = explode('=', $Array[$i]);
            $_GET[(string) $ElementArray[0]] = $ElementArray[1];
            $_REQUEST[(string) $ElementArray[0]] = $ElementArray[1];
            $NewArray[(string) $ElementArray[0]] = $ElementArray[0] . "=" . $ElementArray[1];
        }
    }
    //附加GET变量形成部分
    for ($i = 1; $i < sizeof($QUERY_STRING_ARRAY); $i++) {
        if ($QUERY_STRING_ARRAY[$i] != "") {
            $ElementArray = explode('=', $QUERY_STRING_ARRAY[$i]);
            $_GET[(string) $ElementArray[0]] = $ElementArray[1];
            $_REQUEST[(string) $ElementArray[0]] = $ElementArray[1];
            $NewArray[(string) $ElementArray[0]] = $ElementArray[0] . "=" . $ElementArray[1];
        }
    }
    //print_R($NewArray);
    //形成新的_SERVER变量信息
    $_SERVER['QUERY_STRING'] = join('&', @array_values($NewArray));
    $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'];
}