Post by andreis » Tue Sep 29, 2015 4:54 am

It looks like when trying to insert the Google Analytics Code it returns the following :

"Forbidden
You don't have permission to access /admin/index.php on this server."

Just figured out that you cannot save it as long as you introduce <script> into the field. It works with any text, but not with <script>.

What would be the cause and How to solve it? I tried even on a fresh install and it behaves the same.

Many thanks.

Newbie

Posts

Joined
Fri Jul 24, 2015 12:53 am

Post by straightlight » Tue Sep 29, 2015 4:58 am

Are you using any contributions for Google Analytics? If not, could you specify from which page exactly you're integrating your Google Analytics code?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by andreis » Tue Sep 29, 2015 8:37 pm

Let me explain what I do:

I am going to System / Settings / Exter Store Settings / Go go Google Tab / Paste Google Analytics Code into the empty field.

I assume I copy/paste the tracking code in the following format:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-xxxxxxxx-x', 'auto');
ga('send', 'pageview');
</script>

Newbie

Posts

Joined
Fri Jul 24, 2015 12:53 am

Post by straightlight » Wed Sep 30, 2015 12:38 am

Interesting ... in admin/controller/setting/setting.php file,

find:

Code: Select all

if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
add righ below:

Code: Select all

foreach ($this->request->post as $key => $value) {
                         if (!is_array($this->request->post[$key])) {
				$this->request->post[$key] = strip_tags(html_entity_decode(trim($this->request->post[$key]), ENT_QUOTES, 'UTF-8'));
                                }
			}
See if that corrects the problem.
Last edited by straightlight on Thu Oct 01, 2015 6:54 am, edited 1 time in total.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by andreis » Thu Oct 01, 2015 4:01 am

Oh, I just try it and it completely messed up my settings in the database I assume.

What the cod actually did? Please help revert it somehow. I removed the code, but it's still a mess when I log in the asmin area. Thanks.

This is what I get when I log in the backend:

"Warning: implode(): Invalid arguments passed in /home/parkfun/public_html/xyz.com/admin/controller/common/header.php on line 58Warning: implode(): Invalid arguments passed in /home/parkfun/public_html/xyz.com/admin/controller/common/header.php on line 59Warning: implode(): Invalid arguments passed in /home/parkfun/public_html/xyz.com/admin/controller/common/header.php on line 62Warning: implode(): Invalid arguments passed in /home/parkfun/public_html/xyz.com/admin/controller/common/header.php on line 63Warning: implode(): Invalid arguments passed in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 14Warning: implode(): Invalid arguments passed in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 22Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: array_merge(): Argument #1 is not an array in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37Warning: in_array() expects parameter 2 to be array, null given in /home/parkfun/public_html/xyz.com/admin/controller/common/stats.php on line 37"

Newbie

Posts

Joined
Fri Jul 24, 2015 12:53 am

Post by straightlight » Thu Oct 01, 2015 6:55 am

I have now edited my code above. It would make sense that sanitizing the posted variables cannot be done over un-extracted arrays which is why you were receiving that error message.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by andreis » Fri Oct 02, 2015 1:33 am

I think my problem it is somehow related with my hosting provider. Maybe I am wrong, but that's impossible to have such problem on fresh install and nobody could report it.

Newbie

Posts

Joined
Fri Jul 24, 2015 12:53 am

Post by straightlight » Fri Oct 02, 2015 5:07 am

Does the changes above saves the data successfully since?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by andreis » Tue Oct 06, 2015 2:38 am

I had to do it on a test entity. Unfortunately it doesn't solve the problem. Still, when I save it after dropping the google script I get:
"Forbidden
You don't have permission to access /admin/index.php on this server."

Newbie

Posts

Joined
Fri Jul 24, 2015 12:53 am

Post by andreis » Tue Oct 06, 2015 6:50 pm

Problem solved with hosting company support.

The problem described above is not Opencart related.

Hosting company tells me that it was a security filter they applied. They did not disclosed more details.

Newbie

Posts

Joined
Fri Jul 24, 2015 12:53 am
Who is online

Users browsing this forum: No registered users and 47 guests