Process input text in the script data state
@return int The next state index
486258
protected function scriptDataState() {
		if ( $this->appropriateEndTag === null ) {
			$this->pos = $this->length;
			return self::STATE_EOF;
		}

		$re = <<<REGEX
~
			(?: # Outer loop start
				# Script data state
				# Stop iteration if we previously matched an appropriate end tag.
				# This is a conditional subpattern: if capture 1 previously
				# matched, then run the pattern /$./ which always fails.
				(?(1) $. )
				.*?
				(?:
					$ |
					(
						</ {$this->appropriateEndTag}
						# If we hit the "anything else" case in the script data
						# end tag name state, don't exit
						(?= [\t\n\f />] )
					) | # 1. Appropriate end tag
					<!--
					# Script data escaped dash dash state
					# Hyphens at this point are consumed without a state transition
					# and so are not part of a comment-end.
					-*+

					(?: # Inner loop start
						# Script data escaped state
						.*?
						(?:
							$ |
							# Stop at, but do not consume, comment-close or end tag.
							# This causes the inner loop to exit, since restarting the
							# inner loop at this input position will cause the loop
							# body to match zero characters. Repeating a zero-character
							# match causes the repeat to terminate.
							(?= --> ) |
							(?= </ {$this->appropriateEndTag} [\t\n\f />] ) |
							<script [\t\n\f />]
							# Script data double escaped state
							.*?
							(?:
								$ |
								# Stop at, but do not consume, comment-close
								(?= --> ) |
								</script [\t\n\f />]
							)
						)
					)*


					# Consume the comment close which exited the inner loop, if any
					(?: --> )?
				)
			)*+
			~xsiA
REGEX;

		do {
			$count = preg_match( $re, $this->text, $m, 0, $this->pos );
			if ( $count === false ) {
				$this->throwPregError();
			} elseif ( !$count ) {
				$this->fatal( 'unexpected regex failure: this pattern can match zero characters' );
			}

			$startPos = $this->pos;
			$matchLength = strlen( $m[0] );
			$endTagLength = isset( $m[1] ) ? strlen( $m[1] ) : 0;
			$textLength = $matchLength - $endTagLength;
			$this->emitRawTextRange( true, $startPos, $textLength );
			$this->pos = $startPos + $matchLength;
			$tagStartPos = $startPos + $textLength;

			if ( $endTagLength ) {
				$nextState = $this->handleAttribsAndClose( self::STATE_SCRIPT_DATA,
					$this->appropriateEndTag, true, $tagStartPos );
			} else {
				$nextState = self::STATE_EOF;
			}
		} while ( $nextState === self::STATE_SCRIPT_DATA );
		return $nextState;
	}
1085048
public function process($text)
    {
        $iterations = $this->maxIterations === null ? 1 : $this->maxIterations;
        $context = new ProcessorContext();
        $context->processor = $this;

        while ($iterations--) {
            $context->iterationNumber++;
            $newText = $this->processIteration($text, $context, null);
            if ($newText === $text) {
                break;
            }
            $text = $newText;
            $iterations += $this->maxIterations === null ? 1 : 0;
        }

        return $text;
    }
378631
protected function getInput() {

        $js = [];

        $defaultAltFormat = 'd/m/Y';
        $defaultFormat    = 'Y-m-d';

        if ($this->element['enableTime'] == "true") {
            $defaultAltFormat .= ' H:i';
            $defaultFormat    .= ' H:i';
        }

        if ($this->element['enableSeconds'] == "true") {
            $defaultAltFormat .= ':S';
            $defaultAltFormat .= ':S';
        }

        $class         = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
        $placeholder   = $this->element['placeholder'] ? ' placeholder="' . htmlspecialchars((string) $this->element['placeholder']) . '"' : null;
        $altFormat     = $this->element['displayFormat'] ? (string) $this->element['displayFormat'] : $defaultAltFormat;
        $defaultFormat = $this->element['dateFormat'] ? (string) $this->element['dateFormat'] : $defaultFormat;
        $minDate       = $this->element['minDate'] ? (string) $this->element['minDate'] : null;
        $maxDate       = $this->element['maxDate'] ? (string) $this->element['maxDate'] : null;

        $options = [
            "altInput"   => true,
            "altFormat"  => $this->getText()->translate($altFormat),
            "utc"        => false,
            "time_24hr"  => true,
            "dateFormat" => $defaultFormat
        ];

        if ($this->element['class']) {
            $options["altInputClass"] = (string) $this->element['class'];
        }

        if ($this->element['allowInput']) {
            $options['allowInput'] = ($this->element['allowInput'] == "true");
        }

        if ($this->element['dateFormat']) {
            $options['dateFormat'] = (string) $this->element['dateFormat'];
        }

        if ($this->element['enableTime']) {
            $options['enableTime'] = ($this->element['enableTime'] == "true");
        }

        if ($this->element['hourIncrement']) {
            $options['hourIncrement'] = (int) $this->element['hourIncrement'];
        }

        if ($this->element['minuteIncrement']) {
            $options['minuteIncrement'] = (int) $this->element['minuteIncrement'];
        }

        if ($this->element['nextArrow']) {
            $options['nextArrow'] = (string) $this->element['nextArrow'];
        }

        if ($this->element['noCalendar']) {
            $options['noCalendar'] = ($this->element['noCalendar'] == "true");
        }

        if ($this->element['prevArrow']) {
            $options['prevArrow'] = (string) $this->element['prevArrow'];
        }

        if ($this->element['shorthandCurrentMonth']) {
            $options['shorthandCurrentMonth'] = ($this->element['shorthandCurrentMonth'] == "true");
        }

        if ($this->element['static']) {
            $options['static'] = ($this->element['static'] == "true");
        }

        if ($this->element['time_24hr']) {
            $options['time_24hr'] = ($this->element['time_24hr'] == "true");
        }

        if ($this->element['utc']) {
            $options['utc'] = ($this->element['utc'] == "true");
        }

        if (isset($minDate)) {
            if (strpos($minDate, 'field:') !== false) {

                $parts     = explode(".", substr($minDate, 6), 2);
                $fieldName = isset($parts[1]) ? $parts[1] : $parts[0];
                $groupName = isset($parts[1]) ? $parts[0] : null;
                $field     = $this->form->getField($fieldName, $groupName);

                if ($field !== false) {

                    $js[] = "var old_min_" . $field->id . "; 
document.getElementById('" . $field->id . "').addEventListener('change', function() {
    var v = document.getElementById('" . $field->id . "')._flatpickr.selectedDates[0];
    if (v && (!old_min_" . $field->id . " || old_min_" . $field->id . ".getTime() !== v.getTime())) {
        old_min_" . $field->id . " = v;
        document.getElementById('" . $this->id . "')._flatpickr.set('minDate', v);                 
    }
});\n";

                }

            } else {
                $options['minDate'] = $minDate;
            }
        }

        if (isset($maxDate)) {
            if (strpos($maxDate, 'field:') !== false) {

                $parts     = explode(".", substr($maxDate, 6), 2);
                $fieldName = isset($parts[1]) ? $parts[1] : $parts[0];
                $groupName = isset($parts[1]) ? $parts[0] : null;
                $field     = $this->form->getField($fieldName, $groupName);

                if ($field !== false) {

                    $js[] = "var old_max_" . $field->id . "; 
document.getElementById('" . $field->id . "').addEventListener('change', function() {
    var v = document.getElementById('" . $field->id . "')._flatpickr.selectedDates[0];
    if (v && (!old_max_" . $field->id . " || old_max_" . $field->id . ".getTime() !== v.getTime())) {
        old_max_" . $field->id . " = v;
        document.getElementById('" . $this->id . "')._flatpickr.set('maxDate', v);                 
    }
});\n";
                }

            } else {
                $options['maxDate'] = $maxDate;
            }
        }

        if ($this->element['wrap']) {
            $options['wrap'] = ($this->element['wrap'] == "true");
        }

        if ($this->element['clickOpens']) {
            $options['clickOpens'] = ($this->element['clickOpens'] == "true");
        }

        if ($this->element['inline']) {
            $options['inline'] = ($this->element['inline'] == "true");
        }

        if ($this->element['weekNumbers']) {
            $options['weekNumbers'] = ($this->element['weekNumbers'] == "true");
        }

        if ($this->element['weekNumbers']) {
            $options['weekNumbers'] = ($this->element['weekNumbers'] == "true");
        }

        if (!$options['utc'] && !$this->element['localAsValue']) {
            $options['onChange'] = "##STARTFUNC##function(d,s,i) { if (d.length) document.getElementById('" . $this->id . "').value = i.formatDate(d[0].fp_toUTC(), i.config.dateFormat) }##ENDFUNC##";
        }

        $options = str_replace(['"##STARTFUNC##', '##ENDFUNC##"'], "", json_encode($options));
        $options = str_replace('##Q##', '"', $options);
        $options = str_replace('##SLASH##', '/', $options);
        $options = str_replace("\\\\", "\\", $options);

        $js[] = "document.getElementById('" . $this->id . "').flatpickr(" . $options . ");";

        (new RequireJSUtility())
            ->addRequireJSModule("flatpickr", "js/vendor/flatpickr.min")
            ->addDomReadyJS(implode("\n", $js), false, "flatpickr, css!/css/vendor/flatpickr.min.css", false);

        return '<input id="' . $this->id . '" name="' . $this->name . '" type="text"  value="' . htmlspecialchars($this->value, ENT_QUOTES, "UTF-8") . '" ' . $placeholder . $class . '>';

    }
745161
protected function getInput()
	{
		// Initialize some field attributes.
		$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
		$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
		$class = $this->element['class'] ? ' ' . (string) $this->element['class'] : '';
		$readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : '';
		$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';

		// " and \ are always forbidden in email unless escaped.
		$this->value = str_replace(array('"','\\'), '', $this->value);

		// Initialize JavaScript field attributes.
		$onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';

		return '<input type="text" name="' . $this->name . '" class="validate-email' . $class . '" id="' . $this->id . '"' . ' value="'
			. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $size . $disabled . $readonly . $onchange . $maxLength . '/>';
	}
625520
public function processForm()
	{
		$current_state = $this->getCurrent();
		$executed_process = $current_state->processForm();
		// set next state
		$executed_next_state = $this->setNextState($current_state,$executed_process);
		// return success
		return ( $executed_process && $executed_next_state );
	}
18916
protected function processRowsHeads() {
        $cols = $this->getCols();
        $this->data = $this->rows;
        if (!empty($cols)) {
            array_unshift($this->data, $cols);
        }
        return $this->data;
    }
612983
public function getInput()
    {
        $data = $this->getRequest()->getParsedBody();
        
        if (is_array($data)) {
            $files = $this->getRequest()->getUploadedFiles();
            $data = array_replace_recursive($data, (array)$files);
        }
        
        return $data;
    }
571387
protected function processLogicalOrJavaScript()
    {
        return array_merge(
            $this->toArray($this->leftNode->getJavaScriptResult()),
            $this->toArray($this->rightNode->getJavaScriptResult())
        );
    }
1147151
protected function getInput()
	{
		// Initialize some field attributes.
		$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
		$value = $this->element['value'] ? (string) $this->element['value'] : '1';

		if (empty($this->value))
		{
			$checked = (isset($this->element['checked'] )) ? ' checked="checked"' : '';
		}
		else
		{
			$checked = ' checked="checked"';
		}

		// Initialize JavaScript field attributes.
		$onclick = $this->element['onclick'] ? ' onclick="' . (string) $this->element['onclick'] . '"' : '';

		return '<input type="checkbox" name="' . $this->name . '" id="' . $this->id . '"' . ' value="'
			. htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"' . $class . $checked . $disabled . $onclick . ' />';
	}
112941
public function getCurrentLine() {
        // Check the string isn't empty
        if ($this->EOF) {
            // Add one to $this->char because we want the number for the next
            // byte to be processed.
            return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1;
        } else {
            // If the string is empty, we are on the first line (sorta).
            return 1;
        }
    }
827693
protected function getInput()
	{
		if ($this->element['extension'])
		{
			$extension = (string) $this->element['extension'];
		}
		else
		{
			$extension = (string) JFactory::getApplication()->input->get('extension', 'com_content');
		}

		$allowEdit  = ((string) $this->element['edit'] == 'true') ? true : false;
		$allowClear = ((string) $this->element['clear'] != 'false') ? true : false;

		// Load language
		JFactory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR);

		// The active category id field.
		$value = (int) $this->value > 0 ? (int) $this->value : '';

		// Build the script.
		$script = array();

		// Select button script
		$script[] = '	function jSelectCategory_' . $this->id . '(id, title, object) {';
		$script[] = '		document.getElementById("' . $this->id . '_id").value = id;';
		$script[] = '		document.getElementById("' . $this->id . '_name").value = title;';

		if ($allowEdit)
		{
			$script[] = '		if (id == "' . (int) $this->value . '") {';
			$script[] = '			jQuery("#' . $this->id . '_edit").removeClass("hidden");';
			$script[] = '		} else {';
			$script[] = '			jQuery("#' . $this->id . '_edit").addClass("hidden");';
			$script[] = '		}';
		}

		if ($allowClear)
		{
			$script[] = '		jQuery("#' . $this->id . '_clear").removeClass("hidden");';
		}

		$script[] = '		jQuery("#categorySelect' . $this->id . 'Modal").modal("hide");';
		$script[] = '	}';

		// Edit button script
		$script[] = '	function jEditCategory_' . $value . '(title) {';
		$script[] = '		document.getElementById("' . $this->id . '_name").value = title;';
		$script[] = '	}';

		// Clear button script
		static $scriptClear;

		if ($allowClear && !$scriptClear)
		{
			$scriptClear = true;

			$script[] = '	function jClearCategory(id) {';
			$script[] = '		document.getElementById(id + "_id").value = "";';
			$script[] = '		document.getElementById(id + "_name").value = "'
				. htmlspecialchars(JText::_('COM_CATEGORIES_SELECT_A_CATEGORY', true), ENT_COMPAT, 'UTF-8') . '";';
			$script[] = '		jQuery("#"+id + "_clear").addClass("hidden");';
			$script[] = '		if (document.getElementById(id + "_edit")) {';
			$script[] = '			jQuery("#"+id + "_edit").addClass("hidden");';
			$script[] = '		}';
			$script[] = '		return false;';
			$script[] = '	}';
		}

		// Add the script to the document head.
		JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));

		// Setup variables for display.
		$html = array();

		$linkCategories = 'index.php?option=com_categories&amp;view=categories&amp;layout=modal&amp;tmpl=component'
			. '&amp;extension=' . $extension
			. '&amp;function=jSelectCategory_' . $this->id;

		$linkCategory   = 'index.php?option=com_categories&amp;view=category&amp;layout=modal&amp;tmpl=component'
			. '&amp;task=category.edit'
			. '&amp;function=jEditCategory_' . $value;

		if (isset($this->element['language']))
		{
			$linkCategories .= '&amp;forcedLanguage=' . $this->element['language'];
			$linkCategory   .= '&amp;forcedLanguage=' . $this->element['language'];
			$modalTitle = JText::_('COM_CATEGORIES_CHANGE_CATEGORY') . ' &#8212; ' . $this->element['label'];
		}
		else
		{
			$modalTitle = JText::_('COM_CATEGORIES_CHANGE_CATEGORY');
		}

		$urlSelect = $linkCategories . '&amp;' . JSession::getFormToken() . '=1';
		$urlEdit   = $linkCategory . '&amp;id=' . $value . '&amp;' . JSession::getFormToken() . '=1';

		if ($value)
		{
			$db    = JFactory::getDbo();
			$query = $db->getQuery(true)
				->select($db->quoteName('title'))
				->from($db->quoteName('#__categories'))
				->where($db->quoteName('id') . ' = ' . (int) $value);
			$db->setQuery($query);

			try
			{
				$title = $db->loadResult();
			}
			catch (RuntimeException $e)
			{
				JError::raiseWarning(500, $e->getMessage());
			}
		}

		if (empty($title))
		{
			$title = JText::_('COM_CATEGORIES_SELECT_A_CATEGORY', true);
		}

		$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');

		// The current category display field.
		$html[] = '<span class="input-append">';
		$html[] = '<input class="input-medium" id="' . $this->id . '_name" type="text" value="' . $title . '" disabled="disabled" size="35" />';

		// Select category button
		$html[] = '<a'
			. ' class="btn hasTooltip"'
			. ' data-toggle="modal"'
			. ' role="button"'
			. ' href="#categorySelect' . $this->id . 'Modal"'
			. ' title="' . JHtml::tooltipText('COM_CATEGORIES_CHANGE_CATEGORY') . '">'
			. '<span class="icon-file"></span> ' . JText::_('JSELECT')
			. '</a>';

		// Edit category button
		if ($allowEdit)
		{
			$html[] = '<a'
				. ' class="btn hasTooltip' . ($value ? '' : ' hidden') . '"'
				. ' id="' . $this->id . '_edit"'
				. ' data-toggle="modal"'
				. ' role="button"'
				. ' href="#categoryEdit' . $value . 'Modal"'
				. ' title="' . JHtml::tooltipText('COM_CATEGORIES_EDIT_CATEGORY') . '">'
				. '<span class="icon-edit"></span> ' . JText::_('JACTION_EDIT')
				. '</a>';
		}

		// Clear category button
		if ($allowClear)
		{
			$html[] = '<button'
				. ' class="btn' . ($value ? '' : ' hidden') . '"'
				. ' id="' . $this->id . '_clear"'
				. ' onclick="return jClearCategory(\'' . $this->id . '\')">'
				. '<span class="icon-remove"></span>' . JText::_('JCLEAR')
				. '</button>';
		}

		$html[] = '</span>';

		// Select category modal
		$html[] = JHtml::_(
			'bootstrap.renderModal',
			'categorySelect' . $this->id . 'Modal',
			array(
				'title'       => $modalTitle,
				'url'         => $urlSelect,
				'height'      => '400px',
				'width'       => '800px',
				'bodyHeight'  => '70',
				'modalWidth'  => '80',
				'footer'      => '<a type="button" class="btn" data-dismiss="modal" aria-hidden="true">'
						. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>',
			)
		);

		// Edit category modal
		$html[] = JHtml::_(
			'bootstrap.renderModal',
			'categoryEdit' . $value . 'Modal',
			array(
				'title'       => JText::_('COM_CATEGORIES_EDIT_CATEGORY'),
				'backdrop'    => 'static',
				'keyboard'    => false,
				'closeButton' => false,
				'url'         => $urlEdit,
				'height'      => '400px',
				'width'       => '800px',
				'bodyHeight'  => '70',
				'modalWidth'  => '80',
				'footer'      => '<a type="button" class="btn" data-dismiss="modal" aria-hidden="true"'
						. ' onclick="jQuery(\'#categoryEdit' . $value . 'Modal iframe\').contents().find(\'#closeBtn\').click();">'
						. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>'
						. '<button type="button" class="btn btn-primary" aria-hidden="true"'
						. ' onclick="jQuery(\'#categoryEdit' . $value . 'Modal iframe\').contents().find(\'#saveBtn\').click();">'
						. JText::_("JSAVE") . '</button>'
						. '<button type="button" class="btn btn-success" aria-hidden="true"'
						. ' onclick="jQuery(\'#categoryEdit' . $value . 'Modal iframe\').contents().find(\'#applyBtn\').click();">'
						. JText::_("JAPPLY") . '</button>',
			)
		);

		// Note: class='required' for client side validation
		$class = $this->required ? ' class="required modal-value"' : '';

		$html[] = '<input type="hidden" id="' . $this->id . '_id"' . $class . ' name="' . $this->name . '" value="' . $value . '" />';

		return implode("\n", $html);
	}
1058924
public function run()
	{
		// if the control word has a previous text element
		if (null !== ($text = $this->getPreviousText())) {
			// if the last character in the text is the space character
			if (substr($text->getText(), -1, 1) == ' ') {
				// remove it
				$text->setText(substr($text->getText(), 0, -1));
			}
		}
		
		// if the control word has a next text element
		if (null !== ($text = $this->getNextText())) {
			// if the first character in the text is the space character
			if (substr($text->getText(), 0, 1) == ' ') {
				// remove it
				$text->setText(substr($text->getText(), 1));
			}
		}
		
		return;
	}
368428
public function processText($text)
    {
        if ((string) $text != '') {
            $store = array();
            $_store = 0;
            $_offset = 0;
            if ($this->parser->strip) {
                if (strpos($text, '<') !== false) {
                    // capture html elements not to be messed with
                    $_offset = 0;
                    if (preg_match_all('#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is',
                                       $text, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
                        foreach ($matches as $match) {
                            $store[] = $match[ 0 ][ 0 ];
                            $_length = strlen($match[ 0 ][ 0 ]);
                            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';
                            $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] - $_offset, $_length);

                            $_offset += $_length - strlen($replace);
                            $_store ++;
                        }
                    }

                    $expressions = array(// replace multiple spaces between tags by a single space
                                         // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements
                                         '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s'                                    => '\1 \2',
                                         // remove spaces between attributes (but not in attribute values!)
                                         '#(([a-z0-9]\s*=\s*("[^"]*?")|(\'[^\']*?\'))|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \5',
                                         '#^\s+<#Ss'                                                               => '<',
                                         '#>\s+$#Ss'                                                               => '>',
                                         $this->stripRegEx                                                         => '');

                    $text = preg_replace(array_keys($expressions), array_values($expressions), $text);
                    $_offset = 0;
                    if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $text, $matches,
                                       PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
                        foreach ($matches as $match) {
                            $_length = strlen($match[ 0 ][ 0 ]);
                            $replace = $store[ $match[ 1 ][ 0 ] ];
                            $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] + $_offset, $_length);

                            $_offset += strlen($replace) - $_length;
                            $_store ++;
                        }
                    }
                } else {
                    $text = preg_replace($this->stripRegEx, '', $text);
                }
            }
            return new Smarty_Internal_ParseTree_Text($text);
        }
        return null;
    }
1231744
private function processOutput()
    {
        foreach ($this->getOutput() as $outputLine) {
            if (strpos($outputLine, $this->TAG_CURRENT_URL) !== false) {
                $this->currentUrl = str_replace(
                    $this->TAG_CURRENT_URL,
                    '',
                    $outputLine
                );
            }

            if (strpos($outputLine, "Navigation requested: url=") !== false) {
                $frag0 = explode('Navigation requested: url=', $outputLine);
                $frag1 = explode(', type=', $frag0[1]);
                $this->requestedUrls[] = $frag1[0];
            }

            if ($this->isDebug()) {
                syslog(LOG_INFO, '[PHP-CASPERJS] ' . $outputLine);
            }
            if (strpos(
                $outputLine,
                $this->TAG_CURRENT_PAGE_CONTENT
            ) !== false
            ) {
                $this->currentPageContent = str_replace(
                    $this->TAG_CURRENT_PAGE_CONTENT,
                    '',
                    $outputLine
                );
            }

            if (strpos($outputLine, $this->TAG_CURRENT_HTML) !== false) {
                $this->currentHtml = str_replace(
                    $this->TAG_CURRENT_HTML,
                    '',
                    $outputLine
                );
            }

            if (strpos($outputLine, " steps in ") !== false) {
                $frag = explode(' steps in ', $outputLine);
                $this->loadTime = $frag[1];
            }

            if (0 === strpos($outputLine, $this->TAG_CURRENT_HEADERS)) {
                $this->headers = json_decode(str_replace($this->TAG_CURRENT_HEADERS, '', $outputLine), true);
            }

            if (0 === strpos($outputLine, $this->TAG_CURRENT_STATUS)) {
                $this->status = (int) str_replace($this->TAG_CURRENT_STATUS, '', $outputLine);
            }

            if (0 === strpos($outputLine, $this->TAG_CURRENT_STATUS_TEXT)) {
                $this->statusText = trim(str_replace($this->TAG_CURRENT_STATUS_TEXT, '', $outputLine));
            }

            if (0 === strpos($outputLine, $this->TAG_CURRENT_COOKIES)) {
                $this->cookies = json_decode(str_replace($this->TAG_CURRENT_COOKIES, '', $outputLine), true);
            }
        }
    }
241807
protected function executeIndex()
    {
        $pid         = (int)$this->postVar['pid'];
        $depth       = (int)$this->postVar['depth'];
        $sysLanguage = (int)$this->postVar['sysLanguage'];

        // Store last selected language
        $this->getBackendUserAuthentication()
            ->setAndSaveSessionData('MetaSEO.sysLanguage', $sysLanguage);

        if (empty($pid)) {

            throw new AjaxException(
                'message.error.typo3_page_not_found',
                '[0x4FBF3C0C]',
                HttpUtility::HTTP_STATUS_BAD_REQUEST
            );
        }

        $page = $this->getPageSeoDao()->getPageById($pid);

        $list = $this->getIndex($page, $depth, $sysLanguage);

        return array(
            'results' => count($list),
            'rows'    => array_values($list),
        );
    }
491699
protected function getInput()
	{
		// Initialize variables.
		$options = array();
		$attr = '';

		// Initialize some field attributes.
		$attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$attr .= ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
		$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
		$attr .= $this->multiple ? ' multiple="multiple"' : '';

		// Initialize JavaScript field attributes.
		$attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';

		// Iterate through the children and build an array of options.
		foreach ($this->element->children() as $option)
		{

			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			// Create a new option object based on the <option /> element.
			$tmp = Dropdown::option((string) $option['value'], trim((string) $option), 'value', 'text',
				((string) $option['disabled'] == 'true')
			);

			// Set some option attributes.
			$tmp->class = (string) $option['class'];

			// Set some JavaScript option attributes.
			$tmp->onclick = (string) $option['onclick'];

			// Add the option object to the result set.
			$options[] = $tmp;
		}

		return Access::usergroup($this->name, $this->value, $attr, $options, $this->id);
	}
1054846
protected function _tick() {
        while (true) {
            // Grab a line of PHP code from the prompt
            $line = $this->_getInput();

            /**
             * Note that $this->__result will be populated, if no target variable is given
             * in the expression. In other words, this will populate $this->__result:
             * $someModel->fetchAll();
             * But this won't:
             * $rows = $someModel->fetchAll();
             * ...because we assume the user wants to do something with the variable.
             */
            if (!$this->_input && !preg_match('/^(\$\w+\s?\=)|print|echo/', $line)) {
                $line = '$this->__result = ' . $line;
            }

            $this->_input .= $line;

            // If no semicolon is found at the end, assume
            // multi-line input. The user is therefore not finished,
            // so we just continue here and wait for that semicolon.
            if (substr($line, -1) !== ';') {
                continue;
            }

            // Execute input, and grab its output
            ob_start(array($this, 'output'));
            eval($this->_input);
            ob_end_flush();

            // Clear result var
            $this->__result = null;
            // Reset input
            $this->_input = '';
        }
    }