Manual:$wgCopyUploadsDomains

Details
A list of allowable domains for Files to be uploaded from. Requires $wgAllowCopyUploads to be true.

Usage
Add to the bottom of your LocalSettings.php: (The above example will allow all uploads from any Wikimedia site).