Make second argument optional

Equivalent to addVendorScript und addScript from OC_Util
Merge pull request #12009 from owncloud/make-optional

Make second argument optional