Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 6135503

Browse files
authored
Merge pull request #66 from JeroenBoersma/magento-1.9
Updated to Magento 1.9.3.9
2 parents 577122d + a55ff8c commit 6135503

File tree

79 files changed

+1423
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1423
-223
lines changed

RELEASE_NOTES.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
==== 1.9.3.9 ====
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
] NOTE: Current Release Notes are maintained at: [
5+
] [
6+
] http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html [
7+
] [
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
111
==== 1.9.3.8 ====
212
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -13,7 +23,7 @@
1323
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1424
] NOTE: Current Release Notes are maintained at: [
1525
] [
16-
] http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html [
26+
] http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html [
1727
] [
1828
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1929
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -23,7 +33,7 @@
2333
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2434
] NOTE: Current Release Notes are maintained at: [
2535
] [
26-
] http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html [
36+
] http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html [
2737
] [
2838
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2939
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -33,7 +43,7 @@
3343
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3444
] NOTE: Current Release Notes are maintained at: [
3545
] [
36-
] http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html [
46+
] http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html [
3747
] [
3848
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3949
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

app/Mage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public static function getVersionInfo()
171171
'major' => '1',
172172
'minor' => '9',
173173
'revision' => '3',
174-
'patch' => '8',
174+
'patch' => '9',
175175
'stability' => '',
176176
'number' => '',
177177
);

app/code/core/Mage/Admin/Model/User.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ protected function _beforeSave()
134134
// Change user password
135135
$data['password'] = $this->_getEncodedPassword($this->getNewPassword());
136136
$data['new_password'] = $data['password'];
137+
$sessionUser = $this->getSession()->getUser();
138+
if ($sessionUser && $sessionUser->getId() == $this->getId()) {
139+
$this->getSession()->setUserPasswordChanged(true);
140+
}
137141
} elseif ($this->getPassword() && $this->getPassword() != $this->getOrigData('password')) {
138142
// New user password
139143
$data['password'] = $this->_getEncodedPassword($this->getPassword());
@@ -154,6 +158,14 @@ protected function _beforeSave()
154158
return parent::_beforeSave();
155159
}
156160

161+
/**
162+
* @return Mage_Admin_Model_Session
163+
*/
164+
protected function getSession()
165+
{
166+
return Mage::getSingleton('admin/session');
167+
}
168+
157169
/**
158170
* Save admin user extra data (like configuration sections state)
159171
*
@@ -400,8 +412,15 @@ public function login($username, $password)
400412
public function reload()
401413
{
402414
$id = $this->getId();
415+
$oldPassword = $this->getPassword();
403416
$this->setId(null);
404417
$this->load($id);
418+
$isUserPasswordChanged = $this->getSession()->getUserPasswordChanged();
419+
if ($this->getPassword() !== $oldPassword && !$isUserPasswordChanged) {
420+
$this->setId(null);
421+
} elseif ($isUserPasswordChanged) {
422+
$this->getSession()->setUserPasswordChanged(false);
423+
}
405424
return $this;
406425
}
407426

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public function __construct()
5757
*/
5858
public function getOptionHtml(Mage_Catalog_Model_Product_Option $option)
5959
{
60+
if (!empty($option['file_extension'])) {
61+
$option['file_extension'] = $this->escapeHtml($option['file_extension']);
62+
}
6063
$renderer = $this->getOptionRender(
6164
$this->getGroupOfOption($option->getType())
6265
);

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public function getOptionValues()
286286
$value['price_type'] = $option->getPriceType();
287287
$value['sku'] = $this->escapeHtml($option->getSku());
288288
$value['max_characters'] = $option->getMaxCharacters();
289-
$value['file_extension'] = $option->getFileExtension();
289+
$value['file_extension'] = $this->escapeHtml($option->getFileExtension());
290290
$value['image_size_x'] = $option->getImageSizeX();
291291
$value['image_size_y'] = $option->getImageSizeY();
292292
if ($this->getProduct()->getStoreId() != '0' &&

app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ public function getEscapedValue($index=null)
169169
$this->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT)
170170
);
171171
}
172-
return $value;
172+
return $this->escapeHtml($value);
173173
}
174174

175-
return parent::getEscapedValue($index);
175+
return $this->escapeHtml(parent::getEscapedValue($index));
176176
}
177-
178177
}

app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ class Mage_Adminhtml_Model_LayoutUpdate_Validator extends Zend_Validate_Abstract
4747
*/
4848
protected $_value;
4949

50+
/**
51+
* XPath expression for checking layout update
52+
*
53+
* @var array
54+
*/
55+
protected $_disallowedXPathExpressions = array(
56+
'*//template',
57+
'*//@template',
58+
'//*[@method=\'setTemplate\']',
59+
'//*[@method=\'setDataUsingMethod\']//*[text() = \'template\']/../*'
60+
);
61+
5062
/**
5163
* Protected expressions
5264
*
@@ -114,7 +126,7 @@ public function isValid($value)
114126
}
115127

116128
// if layout update declare custom templates then validate their paths
117-
if ($templatePaths = $value->xpath('*//template | *//@template | //*[@method=\'setTemplate\']/*')) {
129+
if ($templatePaths = $value->xpath($this->_getXpathValidationExpression())) {
118130
try {
119131
$this->_validateTemplatePath($templatePaths);
120132
} catch (Exception $e) {
@@ -133,6 +145,15 @@ public function isValid($value)
133145
return true;
134146
}
135147

148+
/**
149+
* Returns xPath for validate incorrect path to template
150+
*
151+
* @return string xPath for validate incorrect path to template
152+
*/
153+
protected function _getXpathValidationExpression() {
154+
return implode(" | ", $this->_disallowedXPathExpressions);
155+
}
156+
136157
/**
137158
* Validate template path for preventing access to the directory above
138159
* If template path value has "../" @throws Exception

app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ public function saveAction()
269269
$storeId = $this->getRequest()->getParam('store');
270270
$refreshTree = 'false';
271271
if ($data = $this->getRequest()->getPost()) {
272+
if (isset($data['general']['path'])) {
273+
unset($data['general']['path']);
274+
}
272275
$category->addData($data['general']);
273276
if (!$category->getId()) {
274277
$parentId = $this->getRequest()->getParam('parent');

app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ public function saveAction()
735735
}
736736

737737
try {
738+
$product->validate();
738739
$product->save();
739740
$productId = $product->getId();
740741

app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ public function thumbnailAction()
188188
if ($thumb !== false) {
189189
$image = Varien_Image_Adapter::factory('GD2');
190190
$image->open($thumb);
191+
$this->getResponse()->setHeader('Content-type', $image->getMimeTypeWithOutFileType());
191192
ob_start();
192193
$image->display();
193194
$this->getResponse()->setBody(ob_get_contents());

0 commit comments

Comments
 (0)