/*!
\return the HTTP post variable $var, or $fallbackValue if the post variable does not exist , or null if $fallbackValue is omitted.
\sa variable
3904
function postVariable( $var, $fallbackValue = null )
    {
        $ret = $fallbackValue;
        if ( isset( $_POST[$var] ) )
        {
            $ret = $_POST[$var];
        }
        else if ( $ret === null )
        {
            eZDebug::writeWarning( "Undefined post variable: $var",
                                   "eZHTTPTool" );
        }
        return $ret;
    }
827836
function fetchCollectionAttributeHTTPInput( $collection, $collectionAttribute, $http, $base, $contentObjectAttribute )
    {
        if ( $http->hasPostVariable( $base . "_data_integer_" . $contentObjectAttribute->attribute( "id" ) ) )
        {
            $data = $http->postVariable( $base . "_data_integer_" . $contentObjectAttribute->attribute( "id" ) );
            $data = trim( $data ) != '' ? $data : null;
            $data = str_replace(" ", "", $data);
            $collectionAttribute->setAttribute( "data_int", $data );
            return true;
        }
        return false;
    }
534783
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        if ( $http->hasPostVariable( $base . '_ezkeyword_data_text_' . $contentObjectAttribute->attribute( 'id' ) ) )
        {
            $data = $http->postVariable( $base . '_ezkeyword_data_text_' . $contentObjectAttribute->attribute( 'id' ) );
            $keyword = new eZKeyword();
            $keyword->initializeKeyword( $data );
            $contentObjectAttribute->setContent( $keyword );
            return true;
        }
        return false;
    }
853357
function post()
	{
		$originalProp = $this->props;
		
		# If the ID property is specified for the destination then it must be a list import
		if (array_key_exists('DestinationObject', $this->props)) {
			if (array_key_exists('ID', $this->props['DestinationObject'])){
				$this->props['DestinationObject'] = new SoapVar($this->props['DestinationObject'], SOAP_ENC_OBJECT, 'List', "http://exacttarget.com/wsdl/partnerAPI");
			}
		}
		
		$obj = parent::post();
		$this->props = $originalProp;
		return $obj;
	}
1042893
public function post($variable = null, $default = '', $validator = null)
    {
        $value = $this->returnLocalParam('postParams', $variable, $default);

        return $value;
    }
1059480
public static function getGetPost($variableName)
    {

        $value = null;

        if (isset($_GET[$variableName])) {
            $value = $_GET[$variableName];
        }

        if (isset($_POST[$variableName])) {
            $value = $_POST[$variableName];
        }

        $value = self::stripSlashesDeep($value);

        return $value;
    }
1146223
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        if ( $http->hasPostVariable( $base . "_data_float_" . $contentObjectAttribute->attribute( "id" ) ) )
        {
            $data = $http->postVariable( $base . "_data_float_" . $contentObjectAttribute->attribute( "id" ) );
            $contentObjectAttribute->setHTTPValue( $data );

            $locale = eZLocale::instance();
            $data = $locale->internalNumber( $data );

            $data = str_replace(" ", "", $data);

            $contentObjectAttribute->setAttribute( "data_float", $data );
            return true;
        }
        return false;
    }
789570
public static function fallback($info) {
        $user = isset($info['user']) ? $info['user'] : null;
        $publicKey = isset($info['publicKey']) ? $info['publicKey'] : null;

        if (!$user && $publicKey) {
            $info['user'] = $publicKey;
        } else if (!$publicKey && $user) {
            $info['publicKey'] = $user;
        }

        return $info;
    }
1308208
public function unsafePost($varname, $default = false)
	{
		if(isset($this->postvars[$varname])) {
			return $this->postvars[$varname];
		} else {
			return $default;
		}
	}
1076787
static function result( $actionName, $asObject = false )
    {
        $ini = eZINI::instance( 'browse.ini' );
        $isNodeSelection = $ini->variable( $actionName, 'ReturnType' ) == 'NodeID';
        if ( $isNodeSelection )
            $postName = 'SelectedNodeIDArray';
        else
            $postName = 'SelectedObjectIDArray';
        $http = eZHTTPTool::instance();
        if ( $http->hasPostVariable( $postName ) && !$http->hasPostVariable( 'BrowseCancelButton' ) )
        {
            $postList = $http->postVariable( $postName );
            $list = array();
            foreach ( $postList as $value )
            {
                if ( !is_numeric( $value ) )
                {
                    eZDebug::writeError( "Non-numeric value ($value) found for POST variable $postName for browse action '$actionName', the value will be excluded",
                                         'eZContentBrowse::result' );
                    continue;
                }
                // Append the value as a real integer, avoids XSS problems.
                $intValue = (int)$value;
                if ( $value != $intValue )
                {
                    eZDebug::writeError( "Non-integer value ($value) found for POST variable $postName for browse action '$actionName', the value will be excluded",
                                         'eZContentBrowse::result' );
                    continue;
                }
                $list[] = $intValue;
            }
            return array_unique( $list );
        }
        return false;
    }
117892
private static function getPhpVariableAsText($var)
    {
        if (is_string($var)) {
            return('"'.str_replace(array("\x00", "\x0a", "\x0d", "\x1a", "\x09"), array('\0', '\n', '\r', '\Z', '\t'), $var).'"');
        } elseif (is_int($var) || is_float($var)) {
            return($var);
        } elseif (is_bool($var)) {
            if ($var) {
                return('true');
            } else {
                return('false');
            }
        } elseif (is_array($var)) {
            $result = 'array( ';
            $comma = '';
            foreach ($var as $key => $val) {
                $result .= $comma.self::getPhpVariableAsText($key).' => '.self::getPhpVariableAsText($val);
                $comma = ', ';
            }
            $result .= ' )';

            return($result);
        } elseif (is_object($var)) {
            return 'Object '.get_class($var);
        } elseif (is_resource($var)) {
            return 'Resource '.get_resource_type($var);
        }

        return 'Unknown type variable';
    }
177611
function getRequestUri() {
    if (isset($_SERVER['REQUEST_URI'])) {
      $uri = $_SERVER['REQUEST_URI'];
    }
    else {
      if (isset($_SERVER['argv'])) {
        $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['argv'][0];
      }
      elseif (isset($_SERVER['QUERY_STRING'])) {
        $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
      }
      else {
        $uri = $_SERVER['SCRIPT_NAME'];
      }
    }
    // Prevent multiple slashes to avoid cross site requests via the Form API.
    $uri = '/' . ltrim($uri, '/');

    return $uri;
  }
294044
public function eTag($var = null)
    {
        if ($var !== null) {
            $this->etag = $var;
        }
        if (!isset($this->etag)) {
            $this->etag = (bool)Grav::instance()['config']->get('system.pages.etag');
        }

        return $this->etag;
    }
168876
def post_vars(self):
		
		if self.method() != 'POST':
			raise RuntimeError('Unable to return post vars for non-get method')

		content_type = self.content_type()
		if content_type is None or content_type.lower() != 'application/x-www-form-urlencoded':
			raise RuntimeError('Unable to return post vars with invalid content-type request')

		request_data = self.request_data()
		request_data = request_data.decode() if request_data is not None else ''
		re_search = WWebRequestProto.post_vars_re.search(request_data)
		if re_search is not None:
			return urllib.parse.parse_qs(re_search.group(1), keep_blank_values=1)
252497
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        if ( $http->hasPostVariable( $base . "_data_boolean_" . $contentObjectAttribute->attribute( "id" ) ))
        {
            $data = $http->postVariable( $base . "_data_boolean_" . $contentObjectAttribute->attribute( "id" ) );
            if ( isset( $data ) && $data !== '0' && $data !== 'false' )
                $data = 1;
            else
                $data = 0;
        }
        else
        {
            /*
             * Note: in other DataTypes, false is returned if the variable is not present.
             * Since HTTP checkboxes are not present in the POST when they are not checked,
             * eZBooleanType might behave a bit differently. See EZP-24630 for a concrete use case.
             */
            $data = 0;
        }
        $contentObjectAttribute->setAttribute( "data_int", $data );
        return true;
    }
176231
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
        $useSeconds = ( $contentClassAttribute->attribute( self::USE_SECONDS_FIELD ) == 1 );

        if ( $http->hasPostVariable( $base . '_datetime_year_' . $contentObjectAttribute->attribute( 'id' ) ) and
             $http->hasPostVariable( $base . '_datetime_month_' . $contentObjectAttribute->attribute( 'id' ) ) and
             $http->hasPostVariable( $base . '_datetime_day_' . $contentObjectAttribute->attribute( 'id' ) ) and
             $http->hasPostVariable( $base . '_datetime_hour_' . $contentObjectAttribute->attribute( 'id' ) ) and
             $http->hasPostVariable( $base . '_datetime_minute_' . $contentObjectAttribute->attribute( 'id' ) ) and
             ( !$useSeconds or $http->hasPostVariable( $base . '_datetime_second_' . $contentObjectAttribute->attribute( 'id' ) ) ) )
        {
            $year   = $http->postVariable( $base . '_datetime_year_' . $contentObjectAttribute->attribute( 'id' ) );
            $month  = $http->postVariable( $base . '_datetime_month_' . $contentObjectAttribute->attribute( 'id' ) );
            $day    = $http->postVariable( $base . '_datetime_day_' . $contentObjectAttribute->attribute( 'id' ) );
            $hour   = $http->postVariable( $base . '_datetime_hour_' . $contentObjectAttribute->attribute( 'id' ) );
            $minute = $http->postVariable( $base . '_datetime_minute_' . $contentObjectAttribute->attribute( 'id' ) );
            $second = $useSeconds ? $http->postVariable( $base . '_datetime_second_' . $contentObjectAttribute->attribute( 'id' ) ) : 0;

            if ( ( $year == '' and $month == '' and $day == '' and
                   $hour == '' and $minute == '' and ( !$useSeconds or $second == '' ) ) or
                 !checkdate( $month, $day, $year ) )
            {
                    $stamp = null;
            }
            else
            {
                $dateTime = new eZDateTime();
                $dateTime->setMDYHMS( $month, $day, $year, $hour, $minute, $second );
                $stamp = $dateTime->timeStamp();
            }

            $contentObjectAttribute->setAttribute( 'data_int', $stamp );
            return true;
        }
        return false;
    }
442264
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        $validPostData = false;

    	if ( $http->hasPostVariable( $base . '_data_gmaplocation_latitude_' . $contentObjectAttribute->attribute( 'id' ) )
          && $http->hasPostVariable( $base . '_data_gmaplocation_longitude_' . $contentObjectAttribute->attribute( 'id' ) ) )
        {
    	    $latitude = $http->postVariable( $base . '_data_gmaplocation_latitude_' . $contentObjectAttribute->attribute( 'id' ) );
            $longitude = $http->postVariable( $base . '_data_gmaplocation_longitude_' . $contentObjectAttribute->attribute( 'id' ) );
            $validPostData = $latitude !== '' && $longitude !== '' && is_numeric( $latitude ) && is_numeric( $longitude );
        }

        if ( $validPostData )
        {
            $address = '';
        	if ( $http->hasPostVariable( $base . '_data_gmaplocation_address_' . $contentObjectAttribute->attribute( 'id' ) ) )
            {
                $address = $http->postVariable( $base . '_data_gmaplocation_address_' . $contentObjectAttribute->attribute( 'id' ) );
                $address = htmlentities( $address, ENT_QUOTES , 'UTF-8' );
            }

            if ( $contentObjectAttribute->attribute( 'data_int' ) != 0 )
            {
            	$location = eZGmapLocation::fetch( $contentObjectAttribute->attribute('id'), $contentObjectAttribute->attribute('version') );
            	$location->setAttribute( 'latitude', $latitude );
            	$location->setAttribute( 'longitude', $longitude );
            	$location->setAttribute( 'address', $address );
            }
            else
            {
		        $location = new eZGmapLocation( array(
		                        'contentobject_attribute_id' => $contentObjectAttribute->attribute('id'),
		                        'contentobject_version' => $contentObjectAttribute->attribute('version'),
		                        'latitude' => $latitude,
		                        'longitude' => $longitude,
		                        'address' => $address
		                         ) );
		        $contentObjectAttribute->setAttribute( 'data_int', 1 );
            }
	       $contentObjectAttribute->setContent( $location );
        }
        else if ( $contentObjectAttribute->attribute( 'data_int' ) != 0 )
        {
        	$contentObjectAttribute->setAttribute( 'data_int', 0 );
        	eZGmapLocation::removeById( $contentObjectAttribute->attribute('id'), $contentObjectAttribute->attribute('version') );
        }

        return true;
    }