From 349071f5019581185a62cdd82a9f59455f453b94 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 7 Oct 2010 22:16:18 -0700 Subject: Change version to "3.0+ (git)". --- modules/gallery/helpers/gallery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index b016f436..e2b74b89 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_Core { - const VERSION = "3.0 (Santa Fe)"; + const VERSION = "3.0+ (git)"; /** * If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is -- cgit v1.2.3 From 84731437a7b8cac4a5e3b2c382a20f67f563b04f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 9 Oct 2010 16:24:58 -0700 Subject: Identify robots and don't let them save sessions. --- modules/gallery/helpers/gallery.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index e2b74b89..ac51e2a6 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -74,6 +74,11 @@ class gallery_Core { * request should implement the _event::gallery_ready() handler. */ static function ready() { + // Don't keep a session for robots; it's a waste of database space. + if (request::user_agent("robot")) { + Session::instance()->abort_save(); + } + module::event("gallery_ready"); } -- cgit v1.2.3 From c4454f1f07e34410726480a01370ea9b482500c2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 11 Oct 2010 21:05:39 -0700 Subject: Copy system/config/user_agents.php over to gallery/config so that we can add to the list --- modules/gallery/config/user_agents.php | 120 +++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 modules/gallery/config/user_agents.php (limited to 'modules') diff --git a/modules/gallery/config/user_agents.php b/modules/gallery/config/user_agents.php new file mode 100644 index 00000000..2559e85b --- /dev/null +++ b/modules/gallery/config/user_agents.php @@ -0,0 +1,120 @@ + 'Windows Vista', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 5.1' => 'Windows XP', + 'windows nt 4.0' => 'Windows NT', + 'winnt4.0' => 'Windows NT', + 'winnt 4.0' => 'Windows NT', + 'winnt' => 'Windows NT', + 'windows 98' => 'Windows 98', + 'win98' => 'Windows 98', + 'windows 95' => 'Windows 95', + 'win95' => 'Windows 95', + 'windows' => 'Unknown Windows OS', + 'os x' => 'Mac OS X', + 'intel mac' => 'Intel Mac', + 'ppc mac' => 'PowerPC Mac', + 'powerpc' => 'PowerPC', + 'ppc' => 'PowerPC', + 'cygwin' => 'Cygwin', + 'linux' => 'Linux', + 'debian' => 'Debian', + 'openvms' => 'OpenVMS', + 'sunos' => 'Sun Solaris', + 'amiga' => 'Amiga', + 'beos' => 'BeOS', + 'apachebench' => 'ApacheBench', + 'freebsd' => 'FreeBSD', + 'netbsd' => 'NetBSD', + 'bsdi' => 'BSDi', + 'openbsd' => 'OpenBSD', + 'os/2' => 'OS/2', + 'warp' => 'OS/2', + 'aix' => 'AIX', + 'irix' => 'Irix', + 'osf' => 'DEC OSF', + 'hp-ux' => 'HP-UX', + 'hurd' => 'GNU/Hurd', + 'unix' => 'Unknown Unix OS', +); + +/** + * The order of this array should NOT be changed. Many browsers return + * multiple browser types so we want to identify the sub-type first. + */ +$config['browser'] = array +( + 'Opera' => 'Opera', + 'MSIE' => 'Internet Explorer', + 'Internet Explorer' => 'Internet Explorer', + 'Shiira' => 'Shiira', + 'Firefox' => 'Firefox', + 'Chimera' => 'Chimera', + 'Phoenix' => 'Phoenix', + 'Firebird' => 'Firebird', + 'Camino' => 'Camino', + 'Netscape' => 'Netscape', + 'OmniWeb' => 'OmniWeb', + 'Chrome' => 'Chrome', + 'Safari' => 'Safari', + 'Konqueror' => 'Konqueror', + 'Epiphany' => 'Epiphany', + 'Galeon' => 'Galeon', + 'Mozilla' => 'Mozilla', + 'icab' => 'iCab', + 'lynx' => 'Lynx', + 'links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse', +); + +$config['mobile'] = array +( + 'mobileexplorer' => 'Mobile Explorer', + 'openwave' => 'Open Wave', + 'opera mini' => 'Opera Mini', + 'operamini' => 'Opera Mini', + 'elaine' => 'Palm', + 'palmsource' => 'Palm', + 'digital paths' => 'Palm', + 'avantgo' => 'Avantgo', + 'xiino' => 'Xiino', + 'palmscape' => 'Palmscape', + 'nokia' => 'Nokia', + 'ericsson' => 'Ericsson', + 'blackBerry' => 'BlackBerry', + 'motorola' => 'Motorola', + 'iphone' => 'iPhone', + 'android' => 'Android', +); + +/** + * There are hundreds of bots but these are the most common. + */ +$config['robot'] = array +( + 'googlebot' => 'Googlebot', + 'msnbot' => 'MSNBot', + 'slurp' => 'Inktomi Slurp', + 'yahoo' => 'Yahoo', + 'askjeeves' => 'AskJeeves', + 'fastcrawler' => 'FastCrawler', + 'infoseek' => 'InfoSeek Robot 1.0', + 'lycos' => 'Lycos', +); \ No newline at end of file -- cgit v1.2.3 From db00958cee5e7373cf4bc439d65e687e7ef2d985 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 11 Oct 2010 21:06:00 -0700 Subject: Add MJ12bot and Speedy Spider to the robot list. --- modules/gallery/config/user_agents.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/gallery/config/user_agents.php b/modules/gallery/config/user_agents.php index 2559e85b..24720046 100644 --- a/modules/gallery/config/user_agents.php +++ b/modules/gallery/config/user_agents.php @@ -109,12 +109,14 @@ $config['mobile'] = array */ $config['robot'] = array ( - 'googlebot' => 'Googlebot', - 'msnbot' => 'MSNBot', - 'slurp' => 'Inktomi Slurp', - 'yahoo' => 'Yahoo', - 'askjeeves' => 'AskJeeves', - 'fastcrawler' => 'FastCrawler', - 'infoseek' => 'InfoSeek Robot 1.0', - 'lycos' => 'Lycos', + 'googlebot' => 'Googlebot', + 'msnbot' => 'MSNBot', + 'slurp' => 'Inktomi Slurp', + 'yahoo' => 'Yahoo', + 'askjeeves' => 'AskJeeves', + 'fastcrawler' => 'FastCrawler', + 'infoseek' => 'InfoSeek Robot 1.0', + 'lycos' => 'Lycos', + 'mj12bot' => 'MJ12bot', + 'speedy spider' => 'Speedy Spider', ); \ No newline at end of file -- cgit v1.2.3