API: Add "standard" header and hook for lacksSameOriginSecurity()
[lhc/web/wiklou.git] / includes / api / ApiBase.php
index 7d0ae32..639f6be 100644 (file)
@@ -503,7 +503,13 @@ abstract class ApiBase extends ContextSource {
         * @return bool
         */
        public function lacksSameOriginSecurity() {
-               return $this->getMain()->getRequest()->getVal( 'callback' ) !== null;
+               // Main module has this method overridden
+               // Safety - avoid infinite loop:
+               if ( $this->isMain() ) {
+                       ApiBase::dieDebug( __METHOD__, 'base method was called on main module.' );
+               }
+
+               return $this->getMain()->lacksSameOriginSecurity();
        }
 
        /**