updated editor code from PHP03