# HG changeset patch # User Dan # Date 1183403874 14400 # Node ID ed06961e54dd0393aefa982aa520d2f3655aa400 # Parent 7267c2a67a93ecb3834f4c64fe7b456666160211 Fixed user pages + the new .xx page URL format diff -r 7267c2a67a93 -r ed06961e54dd includes/clientside/static/faders.js --- a/includes/clientside/static/faders.js Sun Jul 01 17:12:42 2007 -0400 +++ b/includes/clientside/static/faders.js Mon Jul 02 15:17:54 2007 -0400 @@ -128,13 +128,19 @@ this.clickHandler = function() { messagebox_click(this, mb_current_obj); }; - if(type & MB_ICONINFORMATION || type & MB_ICONSTOP || type & MB_ICONQUESTION || type & MB_ICONEXCLAMATION || type & MB_ICONLOCK) + if( ( type & MB_ICONINFORMATION || type & MB_ICONSTOP || type & MB_ICONQUESTION || type & MB_ICONEXCLAMATION ) && !(type & MB_ICONLOCK) ) { mydiv.style.paddingLeft = '50px'; mydiv.style.width = '360px'; mydiv.style.backgroundRepeat = 'no-repeat'; mydiv.style.backgroundPosition = '8px 8px'; } + else if ( type & MB_ICONLOCK ) + { + mydiv.style.paddingLeft = '50px'; + mydiv.style.width = '360px'; + mydiv.style.backgroundRepeat = 'no-repeat'; + } if(type & MB_ICONINFORMATION) { diff -r 7267c2a67a93 -r ed06961e54dd includes/functions.php --- a/includes/functions.php Sun Jul 01 17:12:42 2007 -0400 +++ b/includes/functions.php Mon Jul 02 15:17:54 2007 -0400 @@ -2197,9 +2197,18 @@ function dirtify_page_id($page_id) { + global $db, $session, $paths, $template, $plugins; // Common objects // First, replace spaces with underscores $page_id = str_replace(' ', '_', $page_id); + // Exception for userpages for IP addresses + if ( preg_match('/^' . preg_quote($paths->nslist['User']) . '/', $page_id) ) + { + $ip = preg_replace('/^' . preg_quote($paths->nslist['User']) . '/', '', $page_id); + if ( is_valid_ip($ip) ) + return $page_id; + } + preg_match_all('/\.[A-Fa-f0-9][A-Fa-f0-9]/', $page_id, $matches); foreach ( $matches[0] as $id => $char ) @@ -2269,6 +2278,24 @@ return "{$str1}{$needle}{$str2}"; } +/** + * Tells if a given IP address is valid. + * @param string suspected IP address + * @return bool true if valid, false otherwise + */ + +function is_valid_ip($ip) +{ + // These came from phpBB3. + $ipv4 = '(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])'; + $ipv6 = '(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){5}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:))'; + + if ( preg_match("/^{$ipv4}$/", $ip) || preg_match("/^{$ipv6}$/", $ip) ) + return true; + else + return false; +} + //die('
Original:  01010101010100101010100101010101011010'."\nProcessed: ".uncompress_bitfield(compress_bitfield('01010101010100101010100101010101011010')).'
'); ?> diff -r 7267c2a67a93 -r ed06961e54dd plugins/SpecialPageFuncs.php --- a/plugins/SpecialPageFuncs.php Sun Jul 01 17:12:42 2007 -0400 +++ b/plugins/SpecialPageFuncs.php Mon Jul 02 15:17:54 2007 -0400 @@ -295,7 +295,7 @@
About the Enano Content Management System

This website is powered by Enano, the lightweight and open source - CMS that everyone can use. Enano is copyright © 2006 Dan Fuhry. For legal information, along with a list of libraries that Enano + CMS that everyone can use. Enano is copyright © 2006-2007 Dan Fuhry. For legal information, along with a list of libraries that Enano uses, please see Legal Information.

The developers and maintainers of Enano strongly believe that software should not only be free to use, but free to be modified, distributed, and used to create derivative works. For more information about Free Software, check out the