Is it OK to strip a wire in the middle for attaching a fixture?
I believe at one time this was an accepted practice. I found it in my house which was built in 1960. I know I have been in the elctrical field for 25 years and have never seen anyone do it, so I would say its not being used anymore. I don't think it is a hazard, but if you come across it while performing upgrades I would replace it with a standard wire nut connection like you did.