This Stack Exchange answer has some potentially relevant info. One notable excerpt:
The short answer is 'it depends'. [...]
It depends on:
- whether the code is eligible for copyright,
- what license the content of the particular forum is under, and
- what additional license (if any) the individual contributor has put it under.