A light leak during the dark period will prevent photoperiod plants from flowering, not cause it.
Once a plant is 6-8 weeks old it will show pre-flowers in a process known as "sex determination" and it is a bit like reaching puberty.
It does not mean that flowering will actually occur, just that your plant is telling you it is a girl, even if living under 18/6.
Photoperiod plants need 12 hours of uninterrupted darkness for 7-21 days to initiate the flowering process.
If you are growing auto-flowers, yes, it is completely normal for them to flower when living under 18/6.