Process unenclosed field

example: value

@param string $value  Current token
@param array  $option Option
961468
private function processField($value, array $option)
    {
        if($this->continue) {
            $cell = $this->unescapeEnclosure($value, $option['enclosure']);
            $this->joinCell($this->revert . $cell);
        } else {
            $cell = rtrim($value);
            $cell = $this->unescapeEnclosure($cell, $option['enclosure']);
            $this->setCell($cell);
            $this->col++;
        }
    }
859502
protected function cleanUpValue( $value ) {
		$cleanValue = [];
		if ( !is_array( $value ) ) {
			return $cleanValue;
		}
		foreach ( $value as $singleValue ) {
			$singleValue = parent::cleanUpValue( $singleValue );
			// Remove options that we don't have here
			if ( !isset( $this->fields[ $singleValue ] ) ) {
				continue;
			}
			$cleanValue[] = $singleValue;
		}
		return $cleanValue;
	}
801681
public static function encode($value, $options = JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK)
    {
        if ($value instanceof \Traversable)
        {
            $value = \iterator_to_array($value);
        }

        return \json_encode($value, $options);
    }
890314
function setCurlOption($option, $value) {
		$this->debug("setCurlOption option=$option, value=");
		$this->appendDebug($this->varDump($value));
		$this->curl_options[$option] = $value;
	}
487944
public function hidden($name, $value = null, $options = [])
    {
        return $this->input('hidden', $name, $value, $options);
    }
322874
private function processValue($value)
    {
        if ($value === "NOW()") {
            return $this->connection()->quote(gmdate("Y-m-d H:i:s"));
        } elseif ($value === "NULL") {
            return 'NULL';
        } elseif (is_array($value)) {
            return $this->connection()->quote(json_encode($value));
        } else {
            return $this->connection()->quote($value);
        }
    }
670522
public function setOption(string $option, $value) {
        $this->validateOption($option, $value);
        $this->options[$option] = $value;
    }
1108295
public function mask(string $value, array $options = []) {
		$options['mask'] = $options['mask'] ?? '*';
		$temp = explode('@', trim($value));
		$length = strlen($temp[0]);
		$result = substr($temp[0], 0, floor($length / 2));
		for ($i = 0; $i <= $length - strlen($result); $i++) {
			$result.= $options['mask'];
		}
		return $result . '@' . $temp[1];
	}
539735
function setValue($value)
    {
        $this->_createElementsIfNotExist();
        foreach (array_keys($this->_elements) as $key) {
            if (!$this->_appendName) {
                $v = $this->_elements[$key]->_findValue($value);
                if (null !== $v) {
                    $this->_elements[$key]->onQuickFormEvent('setGroupValue', $v, $this);
                }

            } else {
                $elementName = $this->_elements[$key]->getName();
                $index       = strlen($elementName) ? $elementName : $key;
                if (is_array($value)) {
                    if (isset($value[$index])) {
                        $this->_elements[$key]->onQuickFormEvent('setGroupValue', $value[$index], $this);
                    }
                } elseif (isset($value)) {
                    $this->_elements[$key]->onQuickFormEvent('setGroupValue', $value, $this);
                }
            }
        }
    }
12379
protected function processValue(&$value) {
    if (!is_array($value)) {
      // decode encoded (%##) values
      if (preg_match ("/%/", $value)) {
        $value = urldecode($value);
      }
      // make arrays
      if(preg_match("/^{.*}$/", $value)) {
        $arrayValues = StringUtil::quotesplit(substr($value, 1, -1));
        $value = [];
        foreach ($arrayValues as $arrayValue) {
          $value[] = trim($arrayValue);
        }
      }
    }
  }
1236193
protected function _render_select($data, $current_value)
    {
        if (isset($data['options'])) {
            $options = $data['options'];
            unset($data['options']);
        } elseif (isset($data['values'])) {
            $options = $data['values'];
            unset($data['values']);
        } else {
            throw new MissingFieldException('values');
        }

        if (isset($data['all'])) {
            if ($data['all']) {
                $options = array_merge(['' => $data['all']], $options);
            }
            unset($data['all']);
        } else {
            $options = array_merge(['' => $this->_select_all_text], $options);
        }

        $r = PHP_EOL . '  <select';
        foreach (['id', 'name', 'class'] as $attr) {
            if (isset($data[$attr])) {
                $r .= " $attr=\"$data[$attr]\"";
                unset($data[$attr]);
            }
        }

        foreach ($data as $attr => $value) {
            $r .= " $attr=\"" . htmlspecialchars($data[$attr]) . '"';
        }

        $r .= '>' . PHP_EOL;

        foreach ((array)$options as $value => $label) {
            $r .= '    <option value="' . (is_numeric($value) ? $value : htmlspecialchars($value)) . '"';
            /** @noinspection TypeUnsafeComparisonInspection */

            $selected = false;
            if ($value === '') {
                if ($current_value === null || $current_value === '') {
                    $selected = true;
                }
            } elseif ($value === '0' || $value === 0) {
                if ($current_value === '0' || $current_value === 0) {
                    $selected = true;
                }
            } elseif ((string)$value === (string)$current_value) {
                $selected = true;
            }

            if ($selected) {
                $r .= ' selected';
            }
            $r .= '>' . htmlspecialchars($label) . '</option>' . PHP_EOL;
        }
        $r .= '  </select>' . PHP_EOL;

        return $r;
    }
275493
function validate($value, $options = null) {
        global $CFG;
        if (is_array($value) && array_key_exists('text', $value)) {
            $value = $value['text'];
        }
        if (is_array($value)) {
            // nasty guess - there has to be something in the array, hopefully nobody invents arrays in arrays
            $value = implode('', $value);
        }
        $stripvalues = array(
            '#</?(?!img|canvas|hr).*?>#im', // all tags except img, canvas and hr
            '#(\xc2\xa0|\s|&nbsp;)#', // Any whitespaces actually.
        );
        if (!empty($CFG->strictformsrequired)) {
            $value = preg_replace($stripvalues, '', (string)$value);
        }
        if ((string)$value == '') {
            return false;
        }
        return true;
    }
302861
public function option($option, $value = null)
    {
        if (func_num_args() == 1) {
            return Arr::get($this->options, $option);
        }

        $this->options[$option] = $value;

        return $this;
    }
1052142
public static function isEmpty($value, $options = array())
    {
        $value_set = isset($value) && $value != '';

        return sprintf(self::boolean($value_set, $options), $value);
    }
946436
public static function unshiftValue(array &$values, $value)
    {
        $key = Utils::searchValue($values, $value['value'], true);

        if ($key === false) {
            return array_unshift($values, $value);
        }

        $value = array_merge($values[$key], $value);

        array_splice($values, $key, 1);

        return array_unshift($values, $value);
    }
913415
private function processValue($value)
    {
        $this->valueStack[] = $value;
        $value = $this->resolveValue($value);

        if (is_array($value) || is_object($value)) {
            $this->pushStack($value);
        } else {
            $this->outputJson($value, JsonToken::T_VALUE);
            array_pop($this->valueStack);
        }
    }
1070662
protected function processObject(Parameter $param, &$value)
    {
        // Ensure that the array is associative and not numerically indexed
        if (!isset($value[0]) && ($properties = $param->getProperties())) {
            $knownProperties = array();
            foreach ($properties as $property) {
                $name = $property->getName();
                $sentAs = $property->getWireName();
                $knownProperties[$name] = 1;
                if ($property->getData('xmlAttribute')) {
                    $this->processXmlAttribute($property, $value);
                } elseif (isset($value[$sentAs])) {
                    $this->recursiveProcess($property, $value[$sentAs]);
                    if ($name != $sentAs) {
                        $value[$name] = $value[$sentAs];
                        unset($value[$sentAs]);
                    }
                }
            }

            // Remove any unknown and potentially unsafe properties
            if ($param->getAdditionalProperties() === false) {
                $value = array_intersect_key($value, $knownProperties);
            }
        }
    }