Solar panels are inherently diodes by construction. They do not strongly conduct current out of your battery, but they do have large leakage currents which create trouble for your battery over hours and hours.
Typically a barrier diode is used to block the leakage.
Watch for the voltage dropout. Common regs drop 3v, you need an LDO- Low DropOut. Also look at the leakage current inherent to the regulator's output side, the LM317 uses a resistor network on this side and they can only be made so large. You might do better with an op amp as a comparator driving a P Channel MOSFET, but be aware that it has an inherent body diode so it won't prevent leakage back into the panel even with Vgs==0.