Exemplo n.º 1
0
	/**
	* Converts the parameters received as request array into the raw parms text NEVER ESCAPED
	*
	* @param  mixed    $params             Request array or string escaped only if MAGIC_QUOTES are ON
	* @param  boolean  $checkMagicSlashes  TRUE: if magic_quotes are ON, remove slashes, FALSE: never remove slashes
	* @return string                       The raw parms text NEVER addslash-ESCAPED
	*/
	function getRawParamsUnescaped( $params, $checkMagicSlashes ) {
		if( is_array( $params ) ) {
			foreach ( $params as $k => $v ) {
				if ( is_array( $v ) ) {
					if ( isset( $v[0] ) ) {
						$v		=	implode("|*|", $v);
					} else {
						$r		=	'';
						foreach ( $v as $kk => $vv ) {
							$r	.=	'|**|' . $kk . '=' . $vv;
						}
						$v		=	$r;
					}
				}
				if ( $checkMagicSlashes && get_magic_quotes_gpc() ) {
					$v			=	stripslashes( $v );
				}
				$txt[]			=	"$k=$v";
			}
			$ret				=	cbEditRowView::textareaHandling( $txt );
		} else {
			if ( $checkMagicSlashes && get_magic_quotes_gpc() ) {
				$ret			=	stripslashes( $params );
			} else {
				$ret			=	$params;
			}
		}
		return $ret;
	}
 /**
  * Converts the parameters received as request array into the raw parms text NEVER ESCAPED
  *
  * @param  mixed    $params             Request array or string escaped only if MAGIC_QUOTES are ON
  * @param  boolean  $checkMagicSlashes  TRUE: if magic_quotes are ON, remove slashes, FALSE: never remove slashes
  * @return string                       The raw parms text NEVER addslash-ESCAPED
  */
 public static function getRawParamsUnescaped($params, $checkMagicSlashes)
 {
     if (is_array($params)) {
         $txt = array();
         foreach ($params as $k => $v) {
             if (is_array($v)) {
                 if (isset($v[0])) {
                     $v = implode("|*|", $v);
                 } else {
                     $r = '';
                     foreach ($v as $kk => $vv) {
                         $r .= '|**|' . $kk . '=' . $vv;
                     }
                     $v = $r;
                 }
             }
             if ($checkMagicSlashes && get_magic_quotes_gpc()) {
                 $v = stripslashes($v);
             }
             $txt[] = "{$k}={$v}";
         }
         /** @noinspection PhpDeprecationInspection */
         $ret = cbEditRowView::textareaHandling($txt);
     } else {
         if ($checkMagicSlashes && get_magic_quotes_gpc()) {
             $ret = stripslashes($params);
         } else {
             $ret = $params;
         }
     }
     return $ret;
 }