: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
)) || $this->unit($inner) || $this->parenValue($inner))) {
if ($this->parenValue($value)) return true;
if ($this->unit($value)) return true;
if ($this->color($value)) return true;
if ($this->func($value)) return true;
if ($this->_string($value)) return true;
if ($this->keyword($word)) {
if ($this->variable($var)) {
// unquote string (should this work on any type?
if ($this->literal("~") && $this->_string($str)) {
if ($this->literal('\\') && $this->match('([0-9]+)', $m)) {
protected function import(&$out) {
if (!$this->literal('@import')) return false;
// @import "something.css" media;
// @import url("something.css") media;
// @import url(something.css) media;
if ($this->propertyValue($value)) {
protected function mediaQueryList(&$out) {
if ($this->genericList($list, "mediaQuery", ",", false)) {
protected function mediaQuery(&$out) {
if (($this->literal("only") && ($only = true) || $this->literal("not") && ($not = true) || true) && $this->keyword($mediaType)) {
$prop = array("mediaType");
if (isset($only)) $prop[] = "only";
if (isset($not)) $prop[] = "not";
if (!empty($mediaType) && !$this->literal("and")) {
$this->genericList($expressions, "mediaExpression", "and", false);
if (is_array($expressions)) $parts = array_merge($parts, $expressions[2]);
if (count($parts) == 0) {
protected function mediaExpression(&$out) {
if ($this->literal("(") && $this->keyword($feature) && ($this->literal(":") && $this->expression($value) || true) && $this->literal(")")) {
if ($value) $out[] = $value;
} elseif ($this->variable($variable)) {
// an unbounded string stopped by $end
protected function openString($end, &$out, $nestingOpen = null, $rejectStrs = null) {
$oldWhite = $this->eatWhiteDefault;
$this->eatWhiteDefault = false;
// $stop[] = self::$commentMulti;
if (!is_null($rejectStrs)) {
$stop = array_merge($stop, $rejectStrs);
$patt = '(.*?)(' . implode("|", $stop) . ')';
while ($this->match($patt, $m, false)) {
$nestingLevel += substr_count($m[1], $nestingOpen);
$this->count -= strlen($tok);
if ($nestingLevel == 0) {
if (($tok == "'" || $tok == '"') && $this->_string($str)) {
if ($tok == "@{" && $this->interpolation($inter)) {
if (!empty($rejectStrs) && in_array($tok, $rejectStrs)) {
$this->count += strlen($tok);
$this->eatWhiteDefault = $oldWhite;
if (count($content) == 0) return false;
if (is_string(end($content))) {
$content[count($content) - 1] = rtrim(end($content));
protected function _string(&$out) {
if ($this->literal('"', false)) {
} elseif ($this->literal("'", false)) {
// look for either ending delim , escape, or string interpolation
$patt = '([^\n]*?)(@\{|\\\\|' . LessCompiler::preg_quote($delim) . ')';
$oldWhite = $this->eatWhiteDefault;
$this->eatWhiteDefault = false;
while ($this->match($patt, $m, false)) {
$this->count -= strlen($m[2]);
if ($this->interpolation($inter)) {
$this->count += strlen($m[2]);
$content[] = "@{"; // ignore it
} elseif ($m[2] == '\\') {
if ($this->literal($delim, false)) {
$this->count -= strlen($delim);
$this->eatWhiteDefault = $oldWhite;
if ($this->literal($delim)) {
protected function interpolation(&$out) {
$oldWhite = $this->eatWhiteDefault;
$this->eatWhiteDefault = true;
if ($this->literal("@{") && $this->openString("}", $interp, null, array(
)) && $this->literal("}", false)) {
$this->eatWhiteDefault = $oldWhite;
if ($this->eatWhiteDefault) $this->whitespace();
$this->eatWhiteDefault = $oldWhite;
protected function unit(&$unit) {
if (isset($this->buffer[$this->count])) {
$char = $this->buffer[$this->count];
if (!preg_match('/^[0-9]+$/', $char) && $char != ".") return false;
if ($this->match('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) {
empty($m[2]) ? "" : $m[2]
protected function color(&$out) {
if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) {
// consume a list of property values delimited by ; and wrapped in ()
protected function argumentValues(&$args, $delim = ',') {
if (!$this->literal('(')) return false;
if ($this->expressionList($value)) $values[] = $value;
if (!$this->literal($delim)) break; else {
if ($value == null) $values[] = null;
if (!$this->literal(')')) {
// consume an argument definition list surrounded by ()
// each argument is a variable name with optional value
// or at the end a ... or a variable named followed by ...
protected function argumentDef(&$args, &$isVararg, $delim = ',') {
if (!$this->literal('(')) return false;
if ($this->literal("...")) {
if ($this->variable($vname)) {
if ($this->assign() && $this->expressionList($value)) {
if ($this->literal("...")) {
if ($this->value($literal)) {
if (!$this->literal($delim)) break;
if (!$this->literal(')')) {
// consume a list of tags
// this accepts a hanging delimiter
protected function tags(&$tags, $simple = false, $delim = ',') {
while ($this->tag($tt, $simple)) {
if (!$this->literal($delim)) break;
if (count($tags) == 0) return false;
// list of tags of specifying mixin path
// optionally separated by > (lazy, accepts extra >)
protected function mixinTags(&$tags) {
while ($this->tag($tt, true)) {
if (count($tags) == 0) return false;
// a bracketed value (contained within in a tag definition)
protected function tagBracket(&$value) {
if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") {
if ($this->literal('[') && $this->to(']', $c, true) && $this->literal(']', false)) {
if ($this->whitespace()) $value .= " ";
// escape parent selector, (yuck)
$value = str_replace($this->lessc->parentSelector, "$&$", $value);
protected function tagExpression(&$value) {
if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) {