Included pull request from KevMay for SilverStripe 3.x compatibility.