|
From: Jeff M. <jef...@sy...> - 2000-11-16 11:17:11
|
I've just setup phpwiki 1.1.9 and it seems to be working really well apart
from on thing. When pages are entered on a single line they don't get saved
to the DB properly instead it's just saving an empty string.
I've tracked this down to line 85 in savepage.php which is the following.
$pagehash["content"] = preg_split('/[ \t\r]*\n/', chop($content));
The problem seems to be that preg_split returns an empty array when the
regex does not match anything in the string. I've added the following line
just after this line and this solves the problem by checking to see if the
array is empty and if it is setting it to the unsplit content
if( count($pagehash["content"])<1){
$pagehash["content"][1]=$content;
}
Do you see this as a resonable fix or is there a better approach.
|