Keyword

K2 shows media manager if category image is not available

  • Farid
  • Farid's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago #154030 by Farid
While using new version if K2, I faced a strange behavior; if the category image is not available or if you misspell category image name in URL, K2 default media manager shows up in front-end.
If user has logged in Joomla admin area, media manager works and if not it shows login form!
I think that's a security bug and needs fast consideration, or I've messed up somewhere which I don't think because I haven't touched even a single line of code in K2.

Please Log in or Create an account to join the conversation.

  • JoomlaWorks Support Team
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Elite Member
More
9 years 1 month ago #154058 by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic K2 shows media manager if category image is not available
Hi,
K2 media manager is available at frontend for a registered user but with no access for uploading or modifying any of the listed files - folders.

Please Log in or Create an account to join the conversation.

  • Farid
  • Farid's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago #154074 by Farid
I guess you misunderstood my question.
Please see the following screenshots:

imgur.com/a/gaxno

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #154084 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 shows media manager if category image is not available
Are you using any SEO/SEF extensions?

Please Log in or Create an account to join the conversation.

  • Farid
  • Farid's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago #154092 by Farid
Nope. I'm only using clean Joomla installation and latest K2 component (2.7.0).
Although I've changed some of K2 SEO configurations like not showing category ID in URL, etc.

Please Log in or Create an account to join the conversation.

  • JoomlaWorks Support Team
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Elite Member
More
9 years 1 month ago #154095 by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic K2 shows media manager if category image is not available
By default a 404 error is triggered when a file is not found on the server. Instead you have a redirect to onother url and specifically to the media view of the K2 component. Can you verify that your htaccess file is not modified ?

Please Log in or Create an account to join the conversation.

  • Farid
  • Farid's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago #154098 by Farid
I only have default Joomla htaccess file and have never modified it.

Please Log in or Create an account to join the conversation.

  • Farid
  • Farid's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago #154101 by Farid
I checked other websites using new version of K2 and navigating to a non-existent image in items or categories will result in showing media manager, and because of minimum access level required to show media manager, it shows login page if I'm not logged in!!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #154175 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 shows media manager if category image is not available
I just tried this in two different sites without replicating this behaviour.
Both nginx and Apache threw 404 errors.

Can you share you htaccess file?
Is your site live?
Do you have a /media menu item?

Please Log in or Create an account to join the conversation.

  • Farid
  • Farid's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago #154189 by Farid
Well, I tried more different sites and problem seems to exist in all of them.
As I told you, I'm using default htaccess file on my local XAMPP which I found out about this problem.
I don't have a menu to media manager or anything like it
This is an example link using Nginx web server:
tourism.doctv.ir/media/k2/items/cache/94d43e327d9303539cb1e2aac7032668_M.jpg

I have other under development and live websites with same problem.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #154191 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 shows media manager if category image is not available
This one demo.nuevvo.com/sites/j3x/radiowave/media/k2/items/cache/c889234799e865bbe90cee71f6cd2e53_XL.jpg and this one www.joomlaworks.net/media/k2/items/cache/47359a90eed3ee35f2dab5a3c718abb3_L.jpg?t=1461688251 do not produce this issue (both on nginx too). I also tried it in different sites with the same result.

This is a strange issue indeed. I noticed the issue on a IIS server (why anyone uses them is beyond me).

It is most likely related to how your rules treat 404 errors. Can you share your server's rules?

Please Log in or Create an account to join the conversation.

  • Farid
  • Farid's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 1 month ago - 9 years 1 month ago #154202 by Farid
I'm not sure about IIS, but if do this scenario, you can actually face similar problem:
Install a XAMPP server or WAMP (latest version) and then install a clean lastest version of Joomla and then K2, create a category and an item, and you can see the same problem.

My nginx config of the server of the link I provided to you is (sites-available/default):
server {
	listen 80 default_server;
	listen [::]:80 default_server ipv6only=on;
	root /var/www;
	index index.php index.html index.htm;
	server_name localhost;
	client_max_body_size 256M;
	location / {
		try_files $uri $uri/ /index.php?$args;
	}
	location ~ \.php$ {
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass unix:/var/run/php5-fpm.sock;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		include fastcgi_params;
	}
	location ~ /\.ht {
		deny all;
	}
}

nginx.conf:
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
	worker_connections 768;
}
http {
	disable_symlinks off;
	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	include /etc/nginx/mime.types;
	default_type application/octet-stream;
	client_max_body_size 256m;
	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log notice;
	gzip on;
	gzip_disable "msie6";
	gzip_proxied any;
	gzip_comp_level 6;
	gzip_buffers 16 8k;
	gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}
Last edit: 9 years 1 month ago by Farid.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #154247 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 shows media manager if category image is not available
Under MAMP (no XAMPP sorry) it is also generating 404 errors as it should.

I will look at these rules and let you know.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum