Issue #1675260 by chx, effulgentsia, pwolanin, neclimdul: Implement PHP reading/writing secured against 'leaky' script.