From: <var...@us...> - 2009-03-03 20:23:07
|
Revision: 6624 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6624&view=rev Author: vargenau Date: 2009-03-03 20:23:04 +0000 (Tue, 03 Mar 2009) Log Message: ----------- pcre_fix_posix_classes no longer useful Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2009-03-03 16:05:01 UTC (rev 6623) +++ trunk/lib/config.php 2009-03-03 20:23:04 UTC (rev 6624) @@ -324,74 +324,8 @@ return $loc; } -/** string pcre_fix_posix_classes (string $regexp) -* -* Older version (pre 3.x?) of the PCRE library do not support -* POSIX named character classes (e.g. [[:alnum:]]). -* -* This is a helper function which can be used to convert a regexp -* which contains POSIX named character classes to one that doesn't. -* -* All instances of strings like '[:<class>:]' are replaced by the equivalent -* enumerated character class. -* -* Implementation Notes: -* -* Currently we use hard-coded values which are valid only for -* ISO-8859-1. Also, currently on the classes [:alpha:], [:alnum:], -* [:upper:] and [:lower:] are implemented. (The missing classes: -* [:blank:], [:cntrl:], [:digit:], [:graph:], [:print:], [:punct:], -* [:space:], and [:xdigit:] could easily be added if needed.) -* -* This is a hack. I tried to generate these classes automatically -* using ereg(), but discovered that in my PHP, at least, ereg() is -* slightly broken w.r.t. POSIX character classes. (It includes -* "\xaa" and "\xba" in [:alpha:].) -* -* So for now, this will do. --Jeff <da...@da...> 14 Mar, 2001 -*/ function pcre_fix_posix_classes ($regexp) { - global $charset; - if (!isset($charset)) - $charset = CHARSET; // get rid of constant. pref is dynamic and language specific - if (in_array($GLOBALS['LANG'], array('zh'))) - $charset = 'utf-8'; - if (strstr($GLOBALS['LANG'],'.utf-8')) - $charset = 'utf-8'; - elseif (strstr($GLOBALS['LANG'],'.euc-jp')) - $charset = 'euc-jp'; - elseif (in_array($GLOBALS['LANG'], array('ja'))) - //$charset = 'utf-8'; - $charset = 'euc-jp'; - - if (strtolower($charset) == 'utf-8') { // thanks to John McPherson - // until posix class names/pcre work with utf-8 - if (preg_match('/[[:upper:]]/', '\xc4\x80')) - return $regexp; - // utf-8 non-ascii chars: most common (eg western) latin chars are 0xc380-0xc3bf - // we currently ignore other less common non-ascii characters - // (eg central/east european) latin chars are 0xc432-0xcdbf and 0xc580-0xc5be - // and indian/cyrillic/asian languages - - // this replaces [[:lower:]] with utf-8 match (Latin only) - $regexp = preg_replace('/\[\[\:lower\:\]\]/','(?:[a-z]|\xc3[\x9f-\xbf]|\xc4[\x81\x83\x85\x87])', - $regexp); - // this replaces [[:upper:]] with utf-8 match (Latin only) - $regexp = preg_replace('/\[\[\:upper\:\]\]/','(?:[A-Z]|\xc3[\x80-\x9e]|\xc4[\x80\x82\x84\x86])', - $regexp); - } elseif (preg_match('/[[:upper:]]/', '\xC4')) { - // First check to see if our PCRE lib supports POSIX character - // classes. If it does, there's nothing to do. - return $regexp; - } - static $classes = array( - 'alnum' => "0-9A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\xff", - 'alpha' => "A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\xff", - 'upper' => "A-Z\xc0-\xd6\xd8-\xde", - 'lower' => "a-z\xdf-\xf6\xf8-\xff" - ); - $keys = join('|', array_keys($classes)); - return preg_replace("/\[:($keys):]/e", '$classes["\1"]', $regexp); + return $regexp; } function deduce_script_name() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-03-25 11:36:58
|
Revision: 6705 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6705&view=rev Author: rurban Date: 2009-03-25 11:36:56 +0000 (Wed, 25 Mar 2009) Log Message: ----------- keep old functionality Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2009-03-25 11:31:37 UTC (rev 6704) +++ trunk/lib/config.php 2009-03-25 11:36:56 UTC (rev 6705) @@ -99,6 +99,14 @@ if ($version) return $agent and browserVersion() >= $version; else return $agent; } +// NS3 or less +function isBrowserNS3() { + return (isBrowserNetscape() and browserVersion() < 4.0); +} +// NS4 or less +function isBrowserNS4() { + return (isBrowserNetscape() and browserVersion() < 5.0); +} // must omit display alternate stylesheets: konqueror 3.1.4 // http://sourceforge.net/tracker/index.php?func=detail&aid=945154&group_id=6121&atid=106121 function isBrowserKonqueror($version = false) { @@ -352,7 +360,46 @@ * So for now, this will do. --Jeff <da...@da...> 14 Mar, 2001 */ function pcre_fix_posix_classes ($regexp) { - return $regexp; + global $charset; + if (!isset($charset)) + $charset = CHARSET; // get rid of constant. pref is dynamic and language specific + if (in_array($GLOBALS['LANG'], array('zh'))) + $charset = 'utf-8'; + if (strstr($GLOBALS['LANG'],'.utf-8')) + $charset = 'utf-8'; + elseif (strstr($GLOBALS['LANG'],'.euc-jp')) + $charset = 'euc-jp'; + elseif (strstr($GLOBALS['LANG'], 'ja')) + $charset = 'euc-jp'; + + if (strtolower($charset) == 'utf-8') { // thanks to John McPherson + // until posix class names/pcre work with utf-8 + if (preg_match('/[[:upper:]]/', '\xc4\x80')) + return $regexp; + // utf-8 non-ascii chars: most common (eg western) latin chars are 0xc380-0xc3bf + // we currently ignore other less common non-ascii characters + // (eg central/east european) latin chars are 0xc432-0xcdbf and 0xc580-0xc5be + // and indian/cyrillic/asian languages + + // this replaces [[:lower:]] with utf-8 match (Latin only) + $regexp = preg_replace('/\[\[\:lower\:\]\]/','(?:[a-z]|\xc3[\x9f-\xbf]|\xc4[\x81\x83\x85\x87])', + $regexp); + // this replaces [[:upper:]] with utf-8 match (Latin only) + $regexp = preg_replace('/\[\[\:upper\:\]\]/','(?:[A-Z]|\xc3[\x80-\x9e]|\xc4[\x80\x82\x84\x86])', + $regexp); + } elseif (preg_match('/[[:upper:]]/', '\xC4')) { + // First check to see if our PCRE lib supports POSIX character + // classes. If it does, there's nothing to do. + return $regexp; + } + static $classes = array( + 'alnum' => "0-9A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\xff", + 'alpha' => "A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\xff", + 'upper' => "A-Z\xc0-\xd6\xd8-\xde", + 'lower' => "a-z\xdf-\xf6\xf8-\xff" + ); + $keys = join('|', array_keys($classes)); + return preg_replace("/\[:($keys):]/e", '$classes["\1"]', $regexp); } function deduce_script_name() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Marc-Etienne V. <Mar...@al...> - 2009-03-26 18:50:51
|
ru...@us... a écrit : > function pcre_fix_posix_classes ($regexp) { I would drop this function. Perl regexps work in recent PHP versions. I removed it because it created problems. In several configurations I tested, the display was broken in the SystemInfo plugin and/or I had warnings about wrong UTF-8 characters. Regards, Marc-Etienne -- Marc-Etienne Vargenau Alcatel-Lucent France, Route de Villejust, 91620 NOZAY, FRANCE +33 (0)1 30 77 28 33, Mar...@al... |
From: Marc-Etienne V. <Mar...@al...> - 2009-03-26 18:50:56
|
ru...@us... a écrit : > Revision: 6705 > http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6705&view=rev > Author: rurban > Date: 2009-03-25 11:36:56 +0000 (Wed, 25 Mar 2009) > > Log Message: > ----------- > keep old functionality > > Modified Paths: > -------------- > trunk/lib/config.php > > Modified: trunk/lib/config.php > =================================================================== > --- trunk/lib/config.php 2009-03-25 11:31:37 UTC (rev 6704) > +++ trunk/lib/config.php 2009-03-25 11:36:56 UTC (rev 6705) > @@ -99,6 +99,14 @@ > if ($version) return $agent and browserVersion() >= $version; > else return $agent; > } > +// NS3 or less > +function isBrowserNS3() { > + return (isBrowserNetscape() and browserVersion() < 4.0); > +} > +// NS4 or less > +function isBrowserNS4() { > + return (isBrowserNetscape() and browserVersion() < 5.0); > +} Hello Reini, Does someone really use Phpwiki with Netscape 3 or 4? I no longer have access to Netscape 4, so I cannot test and I really doubt everything will work in such an old browser. I think we have to make some choices about what we support. We have no ressources to test 12 themes times 10 browsers times several backends times several databases times several PHP versions. What do you think? Regards, Marc-Etienne -- Marc-Etienne Vargenau Alcatel-Lucent France, Route de Villejust, 91620 NOZAY, FRANCE +33 (0)1 30 77 28 33, Mar...@al... |
From: <var...@us...> - 2009-03-27 12:01:48
|
Revision: 6727 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6727&view=rev Author: vargenau Date: 2009-03-27 12:01:45 +0000 (Fri, 27 Mar 2009) Log Message: ----------- pcre_fix_posix_classes does nothing in Gforge Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2009-03-27 11:54:30 UTC (rev 6726) +++ trunk/lib/config.php 2009-03-27 12:01:45 UTC (rev 6727) @@ -361,6 +361,11 @@ */ function pcre_fix_posix_classes ($regexp) { global $charset; + + if (defined('GFORGE') and GFORGE) { + return $regexp; + } + if (!isset($charset)) $charset = CHARSET; // get rid of constant. pref is dynamic and language specific if (in_array($GLOBALS['LANG'], array('zh'))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-06-04 11:53:25
|
Revision: 6882 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6882&view=rev Author: rurban Date: 2009-06-04 11:52:24 +0000 (Thu, 04 Jun 2009) Log Message: ----------- whitespace only Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2009-06-04 11:48:41 UTC (rev 6881) +++ trunk/lib/config.php 2009-06-04 11:52:24 UTC (rev 6882) @@ -5,7 +5,7 @@ * The user-configurable settings have been moved to IniConfig.php * The run-time code has been moved to lib/IniConfig.php:fix_configs() */ - + if (!defined("LC_ALL")) { // Backward compatibility (for PHP < 4.0.5) if (!check_php_version(4,0,5)) { @@ -16,7 +16,7 @@ define("LC_CTYPE", 2); } } -// debug flags: +// debug flags: define ('_DEBUG_VERBOSE', 1); // verbose msgs and add validator links on footer define ('_DEBUG_PAGELINKS', 2); // list the extraced pagelinks at the top of each pages define ('_DEBUG_PARSER', 4); // verbose parsing steps @@ -47,7 +47,7 @@ // essential internal stuff set_magic_quotes_runtime(0); -/** +/** * Browser Detection Functions * * Current Issues: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-06-15 15:06:58
|
Revision: 6938 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6938&view=rev Author: rurban Date: 2009-06-15 15:06:51 +0000 (Mon, 15 Jun 2009) Log Message: ----------- set_magic_quotes_runtime fix for php6. Do not update the default english/C locale, this is default. Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2009-06-15 13:25:25 UTC (rev 6937) +++ trunk/lib/config.php 2009-06-15 15:06:51 UTC (rev 6938) @@ -45,7 +45,8 @@ */ // essential internal stuff -set_magic_quotes_runtime(0); +if (!check_php_version(6)) + set_magic_quotes_runtime(0); /** * Browser Detection Functions @@ -279,6 +280,7 @@ // [99ms] function update_locale($loc) { + if ($loc == 'C' or $loc == 'en') return; // $LANG or DEFAULT_LANGUAGE is too less information, at least on unix for // setlocale(), for bindtextdomain() to succeed. $setlocale = guessing_setlocale(LC_ALL, $loc); // [56ms] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-09-26 16:52:02
|
Revision: 7158 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7158&view=rev Author: vargenau Date: 2009-09-26 16:51:39 +0000 (Sat, 26 Sep 2009) Log Message: ----------- htmlspecialchars_workaround unused Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2009-09-24 19:42:39 UTC (rev 7157) +++ trunk/lib/config.php 2009-09-26 16:51:39 UTC (rev 7158) @@ -614,60 +614,6 @@ . DATA_PATH . '/uploads/'; } -/** - * htmlspecialchars doesn't support some special 8bit charsets, which we do want to support. - * Well it just prints a warning which we could circumvent. - * Note: unused, since php htmlspecialchars does the same, just prints a warning which we silence - */ -/* -function htmlspecialchars_workaround($str, $quote=ENT_COMPAT, $charset='iso-8859-1') { - if (in_array(strtolower($charset), - array('iso-8859-2', 'iso8859-2', 'latin-2', 'latin2'))) - { - if (! ($quote & ENT_NOQUOTES)) { - $str = str_replace("\"", """, - $str); - } - if ($quote & ENT_QUOTES) { - $str = str_replace("\'", "'", - $str); - } - return str_replace(array("<", ">", "&"), - array("<", ">", "&"), $str); - } - else { - return htmlspecialchars($str, $quote, $charset); - } -} -*/ - -/** - * htmlspecialchars doesn't support some special 8bit charsets, which we do want to support. - * Well it just prints a warning which we could circumvent. - * Note: unused, since php htmlspecialchars does the same, just prints a warning which we silence - */ -/* -function htmlspecialchars_workaround($str, $quote=ENT_COMPAT, $charset='iso-8859-1') { - if (in_array(strtolower($charset), - array('iso-8859-2', 'iso8859-2', 'latin-2', 'latin2'))) - { - if (! ($quote & ENT_NOQUOTES)) { - $str = str_replace("\"", """, - $str); - } - if ($quote & ENT_QUOTES) { - $str = str_replace("\'", "'", - $str); - } - return str_replace(array("<", ">", "&"), - array("<", ">", "&"), $str); - } - else { - return htmlspecialchars($str, $quote, $charset); - } -} -*/ - // For emacs users // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-10-13 06:15:24
|
Revision: 7207 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7207&view=rev Author: rurban Date: 2009-10-13 06:15:17 +0000 (Tue, 13 Oct 2009) Log Message: ----------- detect AppleWebKit (Safari+Chrome) version Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2009-10-12 14:28:59 UTC (rev 7206) +++ trunk/lib/config.php 2009-10-13 06:15:17 UTC (rev 7207) @@ -77,11 +77,13 @@ function browserVersion() { $agent = browserAgent(); if (strstr($agent, "Mozilla/4.0 (compatible; MSIE")) - return (float) substr($agent, 30); + return (float)substr($agent, 30); elseif (strstr($agent, "Mozilla/5.0 (compatible; Konqueror/")) - return (float) substr($agent, 36); + return (float)substr($agent, 36); + elseif (strstr($agent, "AppleWebKit/")) + return (float)substr($agent, strpos($agent, "AppleWebKit/") + 12); else - return (float) substr($agent, 8); + return (float)substr($agent, 8); } function isBrowserIE() { return (browserDetect('Mozilla/') and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-31 12:55:31
|
Revision: 7452 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7452&view=rev Author: vargenau Date: 2010-05-31 12:55:25 +0000 (Mon, 31 May 2010) Log Message: ----------- Let's assume PHP >= 4.2 Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-05-31 12:50:50 UTC (rev 7451) +++ trunk/lib/config.php 2010-05-31 12:55:25 UTC (rev 7452) @@ -423,27 +423,6 @@ return preg_match("%^${requri}[^/]*$%", $GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); } -// >= php-4.1.0 -if (!function_exists('array_key_exists')) { // lib/IniConfig.php, sqlite, adodb, ... - function array_key_exists($item, $array) { - return isset($array[$item]); - } -} - -// => php-4.0.5 -if (!function_exists('is_scalar')) { // lib/stdlib.php:wikihash() - function is_scalar($x) { - return is_numeric($x) or is_string($x) or is_float($x) or is_bool($x); - } -} - -// => php-4.2.0. pear wants to break old php's! DB uses it now. -if (!function_exists('is_a')) { - function is_a($item,$class) { - return isa($item,$class); - } -} - // needed < php5 // by bradhuizenga at softhome dot net from the php docs if (!function_exists('str_ireplace')) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-31 12:59:20
|
Revision: 7453 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7453&view=rev Author: vargenau Date: 2010-05-31 12:59:14 +0000 (Mon, 31 May 2010) Log Message: ----------- Remove unused function isBrowserIE55 Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-05-31 12:55:25 UTC (rev 7452) +++ trunk/lib/config.php 2010-05-31 12:59:14 UTC (rev 7453) @@ -83,11 +83,6 @@ return (browserDetect('Mozilla/') and browserDetect('MSIE')); } -// problem with transparent PNG's -function isBrowserIE55() { - return (isBrowserIE() and - browserVersion() > 5.1 and browserVersion() < 6.0); -} // old Netscape prior to Mozilla function isBrowserNetscape($version = false) { $agent = (browserDetect('Mozilla/') and @@ -115,7 +110,6 @@ return browserDetect('Opera/'); } - /** * If $LANG is undefined: * Smart client language detection, based on our supported languages This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-31 13:06:46
|
Revision: 7455 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7455&view=rev Author: vargenau Date: 2010-05-31 13:06:40 +0000 (Mon, 31 May 2010) Log Message: ----------- Remove unused function isBrowserNetscape Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-05-31 13:02:02 UTC (rev 7454) +++ trunk/lib/config.php 2010-05-31 13:06:40 UTC (rev 7455) @@ -83,14 +83,6 @@ return (browserDetect('Mozilla/') and browserDetect('MSIE')); } -// old Netscape prior to Mozilla -function isBrowserNetscape($version = false) { - $agent = (browserDetect('Mozilla/') and - ! browserDetect('Gecko/') and - ! browserDetect('MSIE')); - if ($version) return $agent and browserVersion() >= $version; - else return $agent; -} // must omit display alternate stylesheets: konqueror 3.1.4 // http://sourceforge.net/tracker/index.php?func=detail&aid=945154&group_id=6121&atid=106121 function isBrowserKonqueror($version = false) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-05-31 13:15:29
|
Revision: 7456 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7456&view=rev Author: vargenau Date: 2010-05-31 13:15:22 +0000 (Mon, 31 May 2010) Log Message: ----------- Simplify pcre_fix_posix_classes Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-05-31 13:06:40 UTC (rev 7455) +++ trunk/lib/config.php 2010-05-31 13:15:22 UTC (rev 7456) @@ -29,15 +29,6 @@ @preg_match('/CGI/',$GLOBALS['HTTP_ENV_VARS']['GATEWAY_INTERFACE'])); } -/* -// copy some $_ENV vars to $_SERVER for CGI compatibility. php does it automatically since when? -if (isCGI()) { - foreach (explode(':','SERVER_SOFTWARE:SERVER_NAME:GATEWAY_INTERFACE:SERVER_PROTOCOL:SERVER_PORT:REQUEST_METHOD:HTTP_ACCEPT:PATH_INFO:PATH_TRANSLATED:SCRIPT_NAME:QUERY_STRING:REMOTE_HOST:REMOTE_ADDR:REMOTE_USER:AUTH_TYPE:CONTENT_TYPE:CONTENT_LENGTH') as $key) { - $GLOBALS['HTTP_SERVER_VARS'][$key] = &$GLOBALS['HTTP_ENV_VARS'][$key]; - } -} -*/ - // essential internal stuff if (!check_php_version(6)) set_magic_quotes_runtime(0); @@ -45,12 +36,6 @@ /** * Browser Detection Functions * - * Current Issues: - * NS/IE < 4.0 doesn't accept < ? xml version="1.0" ? > - * NS/IE < 4.0 cannot display PNG - * NS/IE < 4.0 cannot display all XHTML tags - * NS < 5.0 needs textarea wrap=virtual - * IE55 has problems with transparent PNG's * @author: ReiniUrban */ function browserAgent() { @@ -114,23 +99,6 @@ if (!$languages) { // make this faster $languages = array("en","de","es","fr","it","ja","zh","nl","sv"); - // ignore possible "_<territory>" and codeset "ja.utf8" - /* - require_once("lib/WikiTheme.php"); - $languages = listAvailableLanguages(); - if (defined('DEFAULT_LANGUAGE') and in_array(DEFAULT_LANGUAGE, $languages)) - { - // remove duplicates - if ($i = array_search(DEFAULT_LANGUAGE, $languages) !== false) { - array_splice($languages, $i, 1); - } - array_unshift($languages, DEFAULT_LANGUAGE); - foreach ($languages as $lang) { - $arr = FileFinder::locale_versions($lang); - $languages = array_merge($languages, $arr); - } - } - */ } $accept = false; @@ -309,78 +277,8 @@ return $loc; } -/** string pcre_fix_posix_classes (string $regexp) -* -* Older version (pre 3.x?) of the PCRE library do not support -* POSIX named character classes (e.g. [[:alnum:]]). -* -* This is a helper function which can be used to convert a regexp -* which contains POSIX named character classes to one that doesn't. -* -* All instances of strings like '[:<class>:]' are replaced by the equivalent -* enumerated character class. -* -* Implementation Notes: -* -* Currently we use hard-coded values which are valid only for -* ISO-8859-1. Also, currently on the classes [:alpha:], [:alnum:], -* [:upper:] and [:lower:] are implemented. (The missing classes: -* [:blank:], [:cntrl:], [:digit:], [:graph:], [:print:], [:punct:], -* [:space:], and [:xdigit:] could easily be added if needed.) -* -* This is a hack. I tried to generate these classes automatically -* using ereg(), but discovered that in my PHP, at least, ereg() is -* slightly broken w.r.t. POSIX character classes. (It includes -* "\xaa" and "\xba" in [:alpha:].) -* -* So for now, this will do. --Jeff <da...@da...> 14 Mar, 2001 -*/ function pcre_fix_posix_classes ($regexp) { - global $charset; - - if (defined('GFORGE') and GFORGE) { - return $regexp; - } - - if (!isset($charset)) - $charset = CHARSET; // get rid of constant. pref is dynamic and language specific - if (in_array($GLOBALS['LANG'], array('zh'))) - $charset = 'utf-8'; - if (strstr($GLOBALS['LANG'],'.utf-8')) - $charset = 'utf-8'; - elseif (strstr($GLOBALS['LANG'],'.euc-jp')) - $charset = 'euc-jp'; - elseif (strstr($GLOBALS['LANG'], 'ja')) - $charset = 'euc-jp'; - - if (strtolower($charset) == 'utf-8') { // thanks to John McPherson - // until posix class names/pcre work with utf-8 - if (preg_match('/[[:upper:]]/', '\xc4\x80')) - return $regexp; - // utf-8 non-ascii chars: most common (eg western) latin chars are 0xc380-0xc3bf - // we currently ignore other less common non-ascii characters - // (eg central/east european) latin chars are 0xc432-0xcdbf and 0xc580-0xc5be - // and indian/cyrillic/asian languages - - // this replaces [[:lower:]] with utf-8 match (Latin only) - $regexp = preg_replace('/\[\[\:lower\:\]\]/','(?:[a-z]|\xc3[\x9f-\xbf]|\xc4[\x81\x83\x85\x87])', - $regexp); - // this replaces [[:upper:]] with utf-8 match (Latin only) - $regexp = preg_replace('/\[\[\:upper\:\]\]/','(?:[A-Z]|\xc3[\x80-\x9e]|\xc4[\x80\x82\x84\x86])', - $regexp); - } elseif (preg_match('/[[:upper:]]/', 'Ä')) { - // First check to see if our PCRE lib supports POSIX character - // classes. If it does, there's nothing to do. - return $regexp; - } - static $classes = array( - 'alnum' => "0-9A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\xff", - 'alpha' => "A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\xff", - 'upper' => "A-Z\xc0-\xd6\xd8-\xde", - 'lower' => "a-z\xdf-\xf6\xf8-\xff" - ); - $keys = join('|', array_keys($classes)); - return preg_replace("/\[:($keys):]/e", '$classes["\1"]', $regexp); + return $regexp; } function deduce_script_name() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-17 15:43:24
|
Revision: 7549 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7549&view=rev Author: vargenau Date: 2010-06-17 15:43:18 +0000 (Thu, 17 Jun 2010) Log Message: ----------- We assume PHP >= 4.3.10 Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-06-17 15:38:19 UTC (rev 7548) +++ trunk/lib/config.php 2010-06-17 15:43:18 UTC (rev 7549) @@ -349,26 +349,6 @@ '); } -/** - * array_diff_assoc() returns an array containing all the values from array1 that are not - * present in any of the other arguments. Note that the keys are used in the comparison - * unlike array_diff(). In core since php-4.3.0 - * Our fallback here supports only hashes and two args. - * $array1 = array("a" => "green", "b" => "brown", "c" => "blue"); - * $array2 = array("a" => "green", "y" => "yellow", "r" => "red"); - * => b => brown, c => blue - */ -if (!function_exists('array_diff_assoc')) { - function array_diff_assoc($a1, $a2) { - $result = array(); - foreach ($a1 as $k => $v) { - if (!isset($a2[$k]) or !$a2[$k]) - $result[$k] = $v; - } - return $result; - } -} - function getUploadFilePath() { if (defined('UPLOAD_FILE_PATH')) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-15 19:09:06
|
Revision: 7616 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7616&view=rev Author: vargenau Date: 2010-07-15 19:09:00 +0000 (Thu, 15 Jul 2010) Log Message: ----------- set_magic_quotes_runtime is deprecated in PHP 5.3 Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2010-07-15 16:03:57 UTC (rev 7615) +++ trunk/lib/config.php 2010-07-15 19:09:00 UTC (rev 7616) @@ -30,8 +30,9 @@ } // essential internal stuff -if (!check_php_version(6)) +if (!check_php_version(5,3)) { set_magic_quotes_runtime(0); +} /** * Browser Detection Functions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2012-10-15 22:54:00
|
Revision: 8416 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8416&view=rev Author: rurban Date: 2012-10-15 22:53:54 +0000 (Mon, 15 Oct 2012) Log Message: ----------- lib/config.php:152 strchr warning, use strpos instead. Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2012-10-11 12:56:58 UTC (rev 8415) +++ trunk/lib/config.php 2012-10-15 22:53:54 UTC (rev 8416) @@ -154,7 +154,7 @@ return $lang_short; } } - if ($pos = strchr($lang, "-") and in_array(substr($lang, 0, $pos), $languages)) + if ($pos = strpos($lang, "-") and in_array(substr($lang, 0, $pos), $languages)) return substr($lang, 0, $pos); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-10-16 08:03:46
|
Revision: 8417 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8417&view=rev Author: vargenau Date: 2012-10-16 08:03:36 +0000 (Tue, 16 Oct 2012) Log Message: ----------- Always return string Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2012-10-15 22:53:54 UTC (rev 8416) +++ trunk/lib/config.php 2012-10-16 08:03:36 UTC (rev 8417) @@ -238,7 +238,9 @@ // [99ms] function update_locale($loc) { - if ($loc == 'C' or $loc == 'en') return; + if ($loc == 'C' or $loc == 'en') { + return ''; + } // $LANG or DEFAULT_LANGUAGE is too less information, at least on unix for // setlocale(), for bindtextdomain() to succeed. $setlocale = guessing_setlocale(LC_ALL, $loc); // [56ms] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-14 17:04:57
|
Revision: 8456 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8456&view=rev Author: vargenau Date: 2012-11-14 17:04:48 +0000 (Wed, 14 Nov 2012) Log Message: ----------- Use &$_SERVER Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2012-11-14 17:01:33 UTC (rev 8455) +++ trunk/lib/config.php 2012-11-14 17:04:48 UTC (rev 8456) @@ -297,7 +297,7 @@ function deduce_script_name() { - $s = &$GLOBALS['HTTP_SERVER_VARS']; + $s = &$_SERVER; $script = @$s['SCRIPT_NAME']; if (empty($script) or $script[0] != '/') { // Some places (e.g. Lycos) only supply a relative name in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-11 15:21:50
|
Revision: 8645 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8645&view=rev Author: vargenau Date: 2012-12-11 15:21:43 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Recursive mkdir Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2012-12-11 14:48:56 UTC (rev 8644) +++ trunk/lib/config.php 2012-12-11 15:21:43 UTC (rev 8645) @@ -386,7 +386,7 @@ if (defined('UPLOAD_FILE_PATH')) { // Force creation of the returned directory if it does not exist. if (!file_exists(UPLOAD_FILE_PATH)) { - mkdir(UPLOAD_FILE_PATH, 0775); + mkdir(UPLOAD_FILE_PATH, 0775, true); } if (string_ends_with(UPLOAD_FILE_PATH, "/") or string_ends_with(UPLOAD_FILE_PATH, "\\") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-19 12:42:08
|
Revision: 9097 http://sourceforge.net/p/phpwiki/code/9097 Author: vargenau Date: 2014-09-19 12:42:04 +0000 (Fri, 19 Sep 2014) Log Message: ----------- str_ireplace exists in PHP 5 Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2014-09-19 10:09:57 UTC (rev 9096) +++ trunk/lib/config.php 2014-09-19 12:42:04 UTC (rev 9097) @@ -315,38 +315,6 @@ return preg_match("%^${requri}[^/]*$%", $GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); } -// needed < php5 -// by bradhuizenga at softhome dot net from the php docs -if (!function_exists('str_ireplace')) { - function str_ireplace($find, $replace, $string) - { - if (!is_array($find)) $find = array($find); - if (!is_array($replace)) { - if (!is_array($find)) - $replace = array($replace); - else { - // this will duplicate the string into an array the size of $find - $c = count($find); - $rString = $replace; - unset($replace); - for ($i = 0; $i < $c; $i++) { - $replace[$i] = $rString; - } - } - } - foreach ($find as $fKey => $fItem) { - $between = explode(strtolower($fItem), strtolower($string)); - $pos = 0; - foreach ($between as $bKey => $bItem) { - $between[$bKey] = substr($string, $pos, strlen($bItem)); - $pos += strlen($bItem) + strlen($fItem); - } - $string = implode($replace[$fKey], $between); - } - return ($string); - } -} - // htmlspecialchars_decode exists for PHP >= 5.1 if (!function_exists('htmlspecialchars_decode')) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-19 12:44:09
|
Revision: 9098 http://sourceforge.net/p/phpwiki/code/9098 Author: vargenau Date: 2014-09-19 12:44:06 +0000 (Fri, 19 Sep 2014) Log Message: ----------- htmlspecialchars_decode exists for PHP >= 5.1 Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2014-09-19 12:42:04 UTC (rev 9097) +++ trunk/lib/config.php 2014-09-19 12:44:06 UTC (rev 9098) @@ -315,16 +315,6 @@ return preg_match("%^${requri}[^/]*$%", $GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); } -// htmlspecialchars_decode exists for PHP >= 5.1 -if (!function_exists('htmlspecialchars_decode')) { - - function htmlspecialchars_decode($text) - { - return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS))); - } - -} - /** * safe php4 definition for clone. * php5 copies objects by reference, but we need to clone "deep copy" in some places. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-09 14:08:13
|
Revision: 9231 http://sourceforge.net/p/phpwiki/code/9231 Author: vargenau Date: 2014-10-09 14:08:01 +0000 (Thu, 09 Oct 2014) Log Message: ----------- Remove unused variable Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2014-10-09 13:42:19 UTC (rev 9230) +++ trunk/lib/config.php 2014-10-09 14:08:01 UTC (rev 9231) @@ -274,9 +274,9 @@ // FIXME: Not all environments may support en_US? We should probably // have a list of locales to try. if (setlocale(LC_CTYPE, 0) == 'C') { - $x = setlocale(LC_CTYPE, 'en_US.UTF-8'); + setlocale(LC_CTYPE, 'en_US.UTF-8'); } else { - $x = setlocale(LC_CTYPE, $setlocale); + setlocale(LC_CTYPE, $setlocale); } return $loc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-17 14:51:54
|
Revision: 9316 http://sourceforge.net/p/phpwiki/code/9316 Author: vargenau Date: 2014-11-17 14:51:47 +0000 (Mon, 17 Nov 2014) Log Message: ----------- Replace "or" with "||" to get correct priority Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2014-11-17 14:48:27 UTC (rev 9315) +++ trunk/lib/config.php 2014-11-17 14:51:47 UTC (rev 9316) @@ -87,7 +87,7 @@ function isBrowserSafari($version = false) { $found = browserDetect('Spoofer/'); - $found = browserDetect('AppleWebKit/') or $found; + $found = browserDetect('AppleWebKit/') || $found; if ($version) return $found and browserVersion() >= $version; return $found; @@ -109,6 +109,7 @@ * So must defer this to the request loop. * * @param array $languages + * @return string */ function guessing_lang($languages = array()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2017-01-11 15:08:47
|
Revision: 9999 http://sourceforge.net/p/phpwiki/code/9999 Author: vargenau Date: 2017-01-11 15:08:45 +0000 (Wed, 11 Jan 2017) Log Message: ----------- Remove obsolete comment Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2017-01-11 15:07:17 UTC (rev 9998) +++ trunk/lib/config.php 2017-01-11 15:08:45 UTC (rev 9999) @@ -31,7 +31,6 @@ /* * NOTE: The settings here should probably not need to be changed. * The user-configurable settings have been moved to IniConfig.php - * The run-time code has been moved to lib/IniConfig.php:fix_configs() */ if (!defined("LC_ALL")) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2017-10-09 19:40:39
|
Revision: 10040 http://sourceforge.net/p/phpwiki/code/10040 Author: vargenau Date: 2017-10-09 19:40:36 +0000 (Mon, 09 Oct 2017) Log Message: ----------- getUploadFilePath() must end with a slash Modified Paths: -------------- trunk/lib/config.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2017-10-03 17:01:36 UTC (rev 10039) +++ trunk/lib/config.php 2017-10-09 19:40:36 UTC (rev 10040) @@ -319,7 +319,7 @@ } return defined('PHPWIKI_DIR') ? PHPWIKI_DIR . "/uploads/" - : realpath(dirname(__FILE__) . "/../uploads/"); + : realpath(dirname(__FILE__) . "/../uploads/")."/"; } function getUploadDataPath() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |