bug #2107583 [GUI] Leading newline truncated, thanks to Isart Montane

This commit is contained in:
Marc Delisle
2008-10-25 14:40:48 +00:00
parent 8c697864eb
commit c62b363942
3 changed files with 26 additions and 4 deletions

View File

@@ -2610,4 +2610,21 @@ function PMA_replace_binary_contents($content) {
$result = str_replace("\x1a", '\Z', $result);
return $result;
}
/**
*
* If the first character given is \n (CR) we will add an extra \n
*
* @uses strpos()
* @return string with the chars replaced
*/
function PMA_duplicateFirstNewline($string){
$first_occurence = strpos($string, "\n");
if($first_occurence == 1){
$string = "\n".$string;
}
return $string;
}
?>