Skip to content

Instantly share code, notes, and snippets.

@gwillem
Created August 6, 2015 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwillem/7f238a250483ce8c676b to your computer and use it in GitHub Desktop.
Save gwillem/7f238a250483ce8c676b to your computer and use it in GitHub Desktop.
diff --git app/code/core/Mage/Api/Model/Server/Adapter/Soap.php app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
index 0f9a3fa..1ac0d57 100644
--- app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
+++ app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
@@ -233,9 +233,9 @@ class Mage_Api_Model_Server_Adapter_Soap
: $urlModel->getUrl('*/*/*');
if ( $withAuth ) {
- $phpAuthUser = $this->getController()->getRequest()->getServer('PHP_AUTH_USER', false);
- $phpAuthPw = $this->getController()->getRequest()->getServer('PHP_AUTH_PW', false);
- $scheme = $this->getController()->getRequest()->getScheme();
+ $phpAuthUser = rawurlencode($this->getController()->getRequest()->getServer('PHP_AUTH_USER', false));
+ $phpAuthPw = rawurlencode($this->getController()->getRequest()->getServer('PHP_AUTH_PW', false));
+ $scheme = rawurlencode($this->getController()->getRequest()->getScheme());
if ($phpAuthUser && $phpAuthPw) {
$wsdlUrl = sprintf("%s://%s:%s@%s", $scheme, $phpAuthUser, $phpAuthPw,
diff --git app/code/core/Mage/Catalog/Model/Product/Api/V2.php app/code/core/Mage/Catalog/Model/Product/Api/V2.php
index ff71ec5..46fc492 100644
--- app/code/core/Mage/Catalog/Model/Product/Api/V2.php
+++ app/code/core/Mage/Catalog/Model/Product/Api/V2.php
@@ -108,7 +108,7 @@ class Mage_Catalog_Model_Product_Api_V2 extends Mage_Catalog_Model_Product_Api
*/
public function create($type, $set, $sku, $productData, $store = null)
{
- if (!$type || !$set || !$sku) {
+ if (!$type || !$set || !$sku || !is_object($productData)) {
$this->_fault('data_invalid');
}
@@ -243,6 +243,9 @@ class Mage_Catalog_Model_Product_Api_V2 extends Mage_Catalog_Model_Product_Api
*/
protected function _prepareDataForSave ($product, $productData)
{
+ if (!is_object($productData)) {
+ $this->_fault('data_invalid');
+ }
if (property_exists($productData, 'website_ids') && is_array($productData->website_ids)) {
$product->setWebsiteIds($productData->website_ids);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment