To avoid the problem caused by a css file edited on a Mac
-
I’m sure this has been reported here a number of times, but if you edit the css file of a theme on a Mac, it screws the thing up because the default line ending of Macintosh(\r) is different from Unix’s(\n) and Windows'(\r\n).
It is caused by the file() function used inside the get_theme_data() function (/wp-includes/function.php). The file() function by default does not recognize the mac line endings.
So I suggest you define the function below somewhere and use it instead of the default file():
function file_wp($filename) {
$f = fopen($filename, “rb”);
$buffer = fread($f, filesize($filename));
fclose($f);
$lines_array = preg_split(“/\r?\n|\r/”, $buffer);
return $lines_array;}
Hope the problem will be gone this way, or any other way for that matter, with a future update.
- The topic ‘To avoid the problem caused by a css file edited on a Mac’ is closed to new replies.