Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed May 13, 2023
2 parents bb9cfc1 + c0d136a commit a07b648
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 32 deletions.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Resource/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function _generateCache()
Mage::app()->saveCache(
Mage::helper('core')->jsonEncode($data),
self::CACHE_ID,
[Mage_Core_Model_App::CACHE_TAG]
[Mage_Core_Model_Resource_Db_Collection_Abstract::CACHE_TAG]
);
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Resource/Variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function _generateCache()
Mage::app()->saveCache(
Mage::helper('core')->jsonEncode($data),
self::CACHE_ID,
[Mage_Core_Model_App::CACHE_TAG]
[Mage_Core_Model_Resource_Db_Collection_Abstract::CACHE_TAG]
);
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Captcha/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
<mode>after_fail</mode>
<forms>backend_forgotpassword</forms>
<failed_attempts_login>3</failed_attempts_login>
<failed_attempts_ip>1000</failed_attempts_ip>
<failed_attempts_ip>10</failed_attempts_ip>
<timeout>7</timeout>
<length>4-5</length>
<symbols>ABCDEFGHJKMnpqrstuvwxyz23456789</symbols>
Expand Down
21 changes: 17 additions & 4 deletions app/code/core/Mage/Captcha/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,22 @@
</depends>
<frontend_class>required-entry validate-digits</frontend_class>
</failed_attempts_login>
<failed_attempts_ip translate="label">
<label>Number of Unsuccessful Attempts to Login per IP Address</label>
<frontend_type>text</frontend_type>
<sort_order>6</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<depends>
<mode>after_fail</mode>
<enable>1</enable>
</depends>
<frontend_class>required-entry validate-digits</frontend_class>
</failed_attempts_ip>
<timeout translate="label">
<label>CAPTCHA Timeout (minutes)</label>
<sort_order>6</sort_order>
<sort_order>7</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
Expand All @@ -89,7 +102,7 @@
<length translate="label comment">
<label>Number of Symbols</label>
<comment>Please specify 8 symbols at the most. Range allowed (e.g. 3-5)</comment>
<sort_order>7</sort_order>
<sort_order>8</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
Expand All @@ -99,7 +112,7 @@
<symbols translate="label comment">
<label>Symbols Used in CAPTCHA</label>
<comment><![CDATA[Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. "i", "l", "1") decrease chance of correct recognition by customer.]]></comment>
<sort_order>8</sort_order>
<sort_order>9</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
Expand All @@ -110,7 +123,7 @@
<label>Case Sensitive</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>9</sort_order>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
Expand Down
6 changes: 0 additions & 6 deletions app/code/core/Mage/Core/Model/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ class Mage_Core_Model_App

public const DISTRO_LOCALE_CODE = 'en_US';

/**
* Cache tag for all cache data exclude config cache
*
*/
public const CACHE_TAG = 'MAGE';

/**
* Default store Id (for install)
*/
Expand Down
9 changes: 1 addition & 8 deletions app/code/core/Mage/Core/Model/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,6 @@ public function save($data, $id, $tags = [], $lifeTime = null)
return true;
}

/**
* Add global magento cache tag to all cached data exclude config cache
*/
if (!in_array(Mage_Core_Model_Config::CACHE_TAG, $tags)) {
$tags[] = Mage_Core_Model_App::CACHE_TAG;
}
return $this->getFrontend()->save((string)$data, $this->_id($id), $this->_tags($tags), $lifeTime);
}

Expand Down Expand Up @@ -427,8 +421,7 @@ public function clean($tags = [])
}
$res = $this->getFrontend()->clean($mode, $this->_tags($tags));
} else {
$res = $this->getFrontend()->clean($mode, [Mage_Core_Model_App::CACHE_TAG]);
$res = $res && $this->getFrontend()->clean($mode, [Mage_Core_Model_Config::CACHE_TAG]);
$this->flush();
}
return $res;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ protected function _saveCache($data, $select)
protected function _getCacheTags()
{
$tags = parent::_getCacheTags();
$tags[] = Mage_Core_Model_App::CACHE_TAG;
$tags[] = self::CACHE_TAG;
return $tags;
}
Expand Down
17 changes: 11 additions & 6 deletions app/code/core/Mage/Log/Model/Visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,22 @@ public function __construct(array $data = [])
protected function _construct()
{
$this->_init('log/visitor');
$userAgent = $this->_httpHelper->getHttpUserAgent();
if ($this->_logCondition->isLogDisabled()) {
$this->_skipRequestLogging = true;
return;
}

$ignoreAgents = $this->_config->getNode('global/ignore_user_agents');
if ($ignoreAgents) {
$ignoreAgents = $ignoreAgents->asArray();
if (in_array($userAgent, $ignoreAgents)) {
$this->_skipRequestLogging = true;
$userAgent = $this->_httpHelper->getHttpUserAgent();
foreach ($ignoreAgents as $ignoreAgent) {
if (stripos($userAgent, $ignoreAgent) !== false) {
$this->_skipRequestLogging = true;
break;
}
}
}
if ($this->_logCondition->isLogDisabled()) {
$this->_skipRequestLogging = true;
}
}

/**
Expand Down
25 changes: 22 additions & 3 deletions app/code/core/Mage/Log/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,28 @@
</entities>
</ignoredModules>
<ignore_user_agents>
<google1>Googlebot/1.0 (googlebot@googlebot.com http://googlebot.com/)</google1>
<google2>Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)</google2>
<google3>Googlebot/2.1 (+http://www.googlebot.com/bot.html)</google3>
<adsbot>AdsBot</adsbot>
<alphabot>AlphaBot</alphabot>
<amazonbot>Amazonbot</amazonbot>
<bingbot>bingbot</bingbot>
<blexbot>BLEXBot</blexbot>
<dotbot>DotBot</dotbot>
<facebookexternalhit>facebookexternalhit</facebookexternalhit>
<google>Googlebot</google>
<google-site-verification>Google-Site-Verification</google-site-verification>
<hrefsbot>AhrefsBot</hrefsbot>
<istellabot>istellabot</istellabot>
<mauibot>MauiBot</mauibot>
<mj12bot>MJ12bot</mj12bot>
<mod_pagespeed>mod_pagespeed</mod_pagespeed>
<opensiteexplorer>spbot</opensiteexplorer>
<pinterestbot>Pinterestbot</pinterestbot>
<semrushbot>SemrushBot</semrushbot>
<seotester>SEOTesterBot</seotester>
<yandexbot>YandexBot</yandexbot>
<yandeximage>YandexImages</yandeximage>
<yandexmobilebot>YandexMobileBot</yandexmobilebot>
<zoominfobot>ZoominfoBot</zoominfobot>
</ignore_user_agents>
<helpers>
<log>
Expand Down
3 changes: 2 additions & 1 deletion app/locale/en_US/Mage_Captcha.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
"Please type the letters from the image:","Please type the letters from the image:"
"Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer."
"Reload captcha","Reload captcha"
"Symbols Used in CAPTCHA","Symbols Used in CAPTCHA"
"Symbols Used in CAPTCHA","Symbols Used in CAPTCHA",
"Number of Unsuccessful Attempts to Login per IP Address","Number of Unsuccessful Attempts to Login per IP Address"

0 comments on commit a07b648

Please sign in to comment.