Porcupines aren't exactly native to humans, so it's really hard to say whether people have actually been attacked by porcupines before or not. However, it's possible. Based on my experience, though I obviously know what one looks like, I have never seen one up close. Not that I want to anyway.
After all, not only are most people smart enough to stay away from porcupines, but even more so, they only attack of out self defense. In other words, if you don't bother them, then they won't bother you. However, on the other hand, most animals have to learn this the hard way.
One thing I wonder though, is how is it possible for a dog to get attacked by a porcupine? Most (if not all) porcupines live in the wild, and because of this, they more than likely won't have many encounters with domesticated animals, such as dogs and cats.
However, regardless, I really like how this article gives some good tips on what to do in case something really does happen. After all, you can never be too sure, right? Though harmless when they don't feel threatened, porcupines are still one of the most dangerous animals, and they're not something you want to cross paths with. Not to mention that their quills can lead to quite an infection if it's not treated properly.