(bug 19907) Adds support for cross-domain AJAX requests to the API.
[lhc/web/wiklou.git] / includes / DefaultSettings.php
index 0944a1e..8f50dda 100644 (file)
@@ -4121,3 +4121,25 @@ $wgAllowPrefChange = array();
  * Array: Ids of namespaces to attempt match in, in desired order.
  */
 $wgSecondaryGoNamespaces = null;
+
+
+/**
+ * Settings for incoming cross-site AJAX requests:
+ * Newer browsers support cross-site AJAX when the target resource allows requests
+ * from the origin domain by the Access-Control-Allow-Origin header.
+ * This is currently only used by the API (requests to api.php)
+ * $wgCrossSiteAJAXdomains can be set as follows:
+ * 
+ * - the string '*' to allow requests from any domain
+ * - an array of domains to allow AJAX requests from, e.g.
+ *   array( 'http://en.wikipedia.org', 'http://en.wikibooks.org' );
+ * - if $wgCrossSiteAJAXdomainsRegex is true, an array of regexes to be
+ *   matched against the request origin. Anything that matches will be allowed
+ */
+$wgCrossSiteAJAXdomains = array();
+
+/**
+ * Set to true to treat $wgCrossSiteAJAXdomains as regexes instead of strings
+ */
+$wgCrossSiteAJAXdomainsRegex = false;
+