Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lessc.inc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* lessphp v0.5.0
* http://leafo.net/lessphp
Expand All @@ -10,7 +9,6 @@
* Licensed under MIT or GPLv3, see LICENSE
*/


/**
* The LESS compiler and parser.
*
Expand Down Expand Up @@ -1988,6 +1986,7 @@ public function __construct($fname = null) {
}

public function compile($string, $name = null) {
$string = preg_replace('/\[([\w-]+)\]/', '___$1___', $string); // Protect CSS named grids
$locale = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, "C");

Expand All @@ -2010,6 +2009,7 @@ public function compile($string, $name = null) {
$this->formatter->block($this->scope);
$out = ob_get_clean();
setlocale(LC_NUMERIC, $locale);
$out = preg_replace('/___([\w-]+)___/', '[$1]', $out); // Remove CSS named grid protections
return $out;
}

Expand Down Expand Up @@ -2449,6 +2449,8 @@ public function __construct($lessc, $sourceName = null) {
}

public function parse($buffer) {
// lessc->compile() will handle unprotecting CSS named grids.
$buffer = preg_replace('/\[([\w-]+)\]/', '___$1___', $buffer); // Protect CSS named grids
$this->count = 0;
$this->line = 1;

Expand Down