You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(43) |
Nov
(73) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(34) |
Feb
(110) |
Mar
(24) |
Apr
(44) |
May
(37) |
Jun
(22) |
Jul
(20) |
Aug
(28) |
Sep
(50) |
Oct
(11) |
Nov
(132) |
Dec
(595) |
2002 |
Jan
(1099) |
Feb
(579) |
Mar
(63) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(125) |
Sep
(101) |
Oct
(25) |
Nov
(34) |
Dec
(47) |
2003 |
Jan
(82) |
Feb
(182) |
Mar
(71) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
(14) |
Oct
(6) |
Nov
(124) |
Dec
(68) |
2004 |
Jan
(64) |
Feb
(191) |
Mar
(199) |
Apr
(298) |
May
(252) |
Jun
(426) |
Jul
(134) |
Aug
(13) |
Sep
(96) |
Oct
(75) |
Nov
(232) |
Dec
(171) |
2005 |
Jan
(205) |
Feb
(165) |
Mar
(8) |
Apr
(74) |
May
(21) |
Jun
(19) |
Jul
(37) |
Aug
(69) |
Sep
(141) |
Oct
(118) |
Nov
(31) |
Dec
(7) |
2006 |
Jan
(5) |
Feb
(10) |
Mar
(35) |
Apr
(24) |
May
(34) |
Jun
(29) |
Jul
(5) |
Aug
(38) |
Sep
(30) |
Oct
(37) |
Nov
(30) |
Dec
(86) |
2007 |
Jan
(414) |
Feb
(40) |
Mar
(18) |
Apr
(10) |
May
(66) |
Jun
(60) |
Jul
(105) |
Aug
(55) |
Sep
(64) |
Oct
(7) |
Nov
(11) |
Dec
(5) |
2008 |
Jan
(26) |
Feb
(28) |
Mar
(79) |
Apr
(34) |
May
(61) |
Jun
(24) |
Jul
(29) |
Aug
(160) |
Sep
(62) |
Oct
(70) |
Nov
(32) |
Dec
(14) |
2009 |
Jan
(140) |
Feb
(135) |
Mar
(153) |
Apr
(53) |
May
(24) |
Jun
(138) |
Jul
(90) |
Aug
(46) |
Sep
(72) |
Oct
(84) |
Nov
(32) |
Dec
(4) |
2010 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(55) |
May
(89) |
Jun
(131) |
Jul
(41) |
Aug
(38) |
Sep
(42) |
Oct
(11) |
Nov
(27) |
Dec
(54) |
2011 |
Jan
(127) |
Feb
(16) |
Mar
(71) |
Apr
(52) |
May
(32) |
Jun
(31) |
Jul
(4) |
Aug
|
Sep
(45) |
Oct
(26) |
Nov
(36) |
Dec
(10) |
2012 |
Jan
(23) |
Feb
(6) |
Mar
(13) |
Apr
(18) |
May
(1) |
Jun
(4) |
Jul
(3) |
Aug
(12) |
Sep
(57) |
Oct
(96) |
Nov
(163) |
Dec
(124) |
2013 |
Jan
(11) |
Feb
(17) |
Mar
(7) |
Apr
(48) |
May
(15) |
Jun
(29) |
Jul
(12) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(3) |
2014 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(8) |
Jun
(90) |
Jul
(104) |
Aug
(12) |
Sep
(81) |
Oct
(139) |
Nov
(111) |
Dec
(64) |
2015 |
Jan
(46) |
Feb
(74) |
Mar
(56) |
Apr
(61) |
May
(3) |
Jun
(7) |
Jul
(11) |
Aug
(5) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
(15) |
2016 |
Jan
(25) |
Feb
(33) |
Mar
(24) |
Apr
(4) |
May
(24) |
Jun
(3) |
Jul
(75) |
Aug
|
Sep
(2) |
Oct
(38) |
Nov
(4) |
Dec
(18) |
2017 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(14) |
Jun
|
Jul
(5) |
Aug
(9) |
Sep
|
Oct
(23) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(9) |
Apr
(60) |
May
(1) |
Jun
|
Jul
(13) |
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(15) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
2021 |
Jan
(24) |
Feb
(33) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(64) |
Jul
(71) |
Aug
(114) |
Sep
(82) |
Oct
(32) |
Nov
(76) |
Dec
(86) |
2022 |
Jan
(162) |
Feb
(41) |
Mar
(11) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2023 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2024 |
Jan
(7) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(90) |
Mar
(19) |
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Geoffrey T. D. <da...@us...> - 2001-02-17 05:35:35
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv2640/lib Modified Files: dbalib.php dbmlib.php Log Message: Fix typo. Index: dbalib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/dbalib.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** dbalib.php 2001/02/12 01:43:10 1.3 --- dbalib.php 2001/02/17 05:36:21 1.4 *************** *** 42,46 **** 'hitcount' => _dbname('hitcountdb')); ! if (preg_match('@%/tmp\b@', $DBParams['directory'])) $DBWarning = "DBA files are in the /tmp directory."; --- 42,46 ---- 'hitcount' => _dbname('hitcountdb')); ! if (preg_match('@^/tmp\b@', $DBParams['directory'])) $DBWarning = "DBA files are in the /tmp directory."; Index: dbmlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/dbmlib.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** dbmlib.php 2001/02/12 01:43:10 1.8 --- dbmlib.php 2001/02/17 05:36:21 1.9 *************** *** 37,41 **** 'hitcount' => _dbname('hitcountdb')); ! if (preg_match('@%/tmp\b@', $DBParams['directory'])) $DBWarning = "DBM files are in the /tmp directory."; --- 37,41 ---- 'hitcount' => _dbname('hitcountdb')); ! if (preg_match('@^/tmp\b@', $DBParams['directory'])) $DBWarning = "DBM files are in the /tmp directory."; |
From: Geoffrey T. D. <da...@us...> - 2001-02-17 05:35:09
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv2528 Modified Files: DBLIB.txt Log Message: Remove notes about $pagehash['refs']. Index: DBLIB.txt =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/DBLIB.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** DBLIB.txt 2000/12/12 21:53:20 1.8 --- DBLIB.txt 2001/02/17 05:35:56 1.9 *************** *** 29,34 **** lastmodified => integer (also Unix time), pagename => string, ! version => integer, ! refs => array (where each element is a reference) }; --- 29,33 ---- lastmodified => integer (also Unix time), pagename => string, ! version => integer }; |
From: Geoffrey T. D. <da...@us...> - 2001-02-17 00:46:22
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv9040/lib Modified Files: stdlib.php Log Message: Fixed my bug: date header in RecentChanges not updating correctly. Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** stdlib.php 2001/02/16 04:43:08 1.34 --- stdlib.php 2001/02/17 00:47:08 1.35 *************** *** 610,620 **** '----'); } - $recentchanges['lastmodified'] = $now; ! if (date($dateformat, $recentchanges['lastmodified']) != $today) { ! $isNewDay = TRUE; ! } else { ! $isNewDay = FALSE; ! } $numlines = sizeof($recentchanges['content']); --- 610,616 ---- '----'); } ! $isNewDay = date($dateformat, $recentchanges['lastmodified']) != $today; ! $recentchanges['lastmodified'] = $now; $numlines = sizeof($recentchanges['content']); |
From: Geoffrey T. D. <da...@us...> - 2001-02-16 05:10:10
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv11072/lib Modified Files: main.php Log Message: Small bug fix Index: main.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** main.php 2001/02/16 04:43:08 1.5 --- main.php 2001/02/16 05:10:54 1.6 *************** *** 4,11 **** include "lib/stdlib.php"; include "lib/userauth.php"; if (ACCESS_LOG) { - include "lib/logger.php"; $LogEntry = new AccessLogEntry; --- 4,11 ---- include "lib/stdlib.php"; include "lib/userauth.php"; + include "lib/logger.php"; if (ACCESS_LOG) { $LogEntry = new AccessLogEntry; *************** *** 17,21 **** { $LogEntry->status = 302; // "302 Found" ! header("Location: " . SERVER_URL . $REQUEST_URI); exit; } --- 17,21 ---- { $LogEntry->status = 302; // "302 Found" ! header("Location: " . SERVER_URL . $REQUEST_URI . '/'); exit; } *************** *** 85,89 **** $user = new WikiUser(get_auth_mode($action)); ! if (ACCESS_LOG and $user->is_authenticated()) $LogEntry->user = $user->id; --- 85,89 ---- $user = new WikiUser(get_auth_mode($action)); ! if ($user->is_authenticated()) $LogEntry->user = $user->id; |
From: Geoffrey T. D. <da...@us...> - 2001-02-16 04:42:24
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv7439/lib Modified Files: config.php main.php stdlib.php userauth.php Added Files: logger.php Log Message: Added support for creating our own NCSA style access_log's. ***** Error reading new file: [Errno 2] No such file or directory: 'logger.php' Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** config.php 2001/02/15 05:57:18 1.33 --- config.php 2001/02/16 04:43:07 1.34 *************** *** 27,31 **** // Set up localization // - if (empty($LANG)) $LANG = "C"; --- 27,30 ---- *************** *** 232,235 **** --- 231,243 ---- } + // Access log + if (!defined('ACCESS_LOG')) + define('ACCESS_LOG', ''); + + // Get remote host name, if apache hasn't done it for us + if (empty($REMOTE_HOST) && ENABLE_REVERSE_DNS) + $REMOTE_HOST = gethostbyaddr($REMOTE_ADDR); + + // For emacs users // Local Variables: Index: main.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** main.php 2001/02/15 19:32:34 1.4 --- main.php 2001/02/16 04:43:08 1.5 *************** *** 5,10 **** --- 5,20 ---- include "lib/userauth.php"; + if (ACCESS_LOG) + { + include "lib/logger.php"; + $LogEntry = new AccessLogEntry; + + function _write_log () { $GLOBALS['LogEntry']->write(ACCESS_LOG); } + register_shutdown_function('_write_log'); + } + if (USE_PATH_INFO && !isset($PATH_INFO)) { + $LogEntry->status = 302; // "302 Found" header("Location: " . SERVER_URL . $REQUEST_URI); exit; *************** *** 73,77 **** --- 83,92 ---- } + $user = new WikiUser(get_auth_mode($action)); + if (ACCESS_LOG and $user->is_authenticated()) + $LogEntry->user = $user->id; + + // All requests require the database Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** stdlib.php 2001/02/15 21:35:03 1.33 --- stdlib.php 2001/02/16 04:43:08 1.34 *************** *** 4,8 **** /* Standard functions for Wiki functionality - ExitWiki($errormsg) WikiURL($pagename, $args, $abs) --- 4,7 ---- *************** *** 29,45 **** return $text; } - - - function get_remote_host () { - // Apache won't show REMOTE_HOST unless the admin configured it - // properly. We'll be nice and see if it's there. - if (getenv('REMOTE_HOST')) - return getenv('REMOTE_HOST'); - $host = getenv('REMOTE_ADDR'); - if (ENABLE_REVERSE_DNS) - return gethostbyaddr($host); - return $host; - } - function arrays_equal ($a, $b) --- 28,31 ---- Index: userauth.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/userauth.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** userauth.php 2001/02/13 05:54:38 1.3 --- userauth.php 2001/02/16 04:43:08 1.4 *************** *** 19,23 **** function WikiUser ($auth_mode = '') { // Restore from cookie. ! global $WIKI_AUTH; if (empty($WIKI_AUTH)) { --- 19,23 ---- function WikiUser ($auth_mode = '') { // Restore from cookie. ! global $WIKI_AUTH, $REMOTE_HOST, $REMOTE_ADDR; if (empty($WIKI_AUTH)) { *************** *** 50,54 **** $this->realm++; $this->state = 'loggedout'; ! $this->userid = get_remote_host(); // Anonymous user id is hostname. } else --- 50,54 ---- $this->realm++; $this->state = 'loggedout'; ! $this->userid = empty($REMOTE_HOST) ? $REMOTE_ADDR : $REMOTE_HOST; } else *************** *** 154,157 **** --- 154,159 ---- header('WWW-Authenticate: Basic realm="' . $this->realm . '"'); header("HTTP/1.0 401 Unauthorized"); + if (ACCESS_LOG) + $LogEntry->status = 401; echo gettext ("You entered an invalid login or password."); ExitWiki(); |
From: Geoffrey T. D. <da...@us...> - 2001-02-16 04:42:24
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv7439 Modified Files: index.php Log Message: Added support for creating our own NCSA style access_log's. Index: index.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/index.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** index.php 2001/02/14 22:02:05 1.10 --- index.php 2001/02/16 04:43:07 1.11 *************** *** 45,48 **** --- 45,52 ---- //$DisabledActions = array('dumpserial', 'loadfile'); + // PhpWiki can generate an access_log (in "NCSA combined log" format) + // for you. If you want one, define this to the name of the log file. + define('ACCESS_LOG', '/tmp/wiki_access_log') + ///////////////////////////////////////////////////////////////////// // |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 21:36:26
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv29361/lib Modified Files: transform.php Log Message: wtm_table: Make LEFT, rather than CENTERED the default alignment for table cells. I just went and edited some tables, and left justification was what I wanted most often. Also agrees with HTML. Index: transform.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/transform.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** transform.php 2001/02/14 05:22:49 1.16 --- transform.php 2001/02/15 21:37:08 1.17 *************** *** 554,563 **** $td['rowspan'] = strlen($m[2]) + 1; ! if ($m[3] == '<') ! $td['align'] = 'left'; else if ($m[3] == '>') $td['align'] = 'right'; else ! $td['align'] = 'center'; $row .= $trfrm->token(StartTag('td', $td) . " "); --- 554,563 ---- $td['rowspan'] = strlen($m[2]) + 1; ! if ($m[3] == '^') ! $td['align'] = 'center'; else if ($m[3] == '>') $td['align'] = 'right'; else ! $td['align'] = 'left'; $row .= $trfrm->token(StartTag('td', $td) . " "); |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 21:34:21
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv29121/templates Modified Files: browse.html editpage.html message.html Log Message: New template token ###ROBOTS_META### to (attempt to) keep robots from indexing pages other than the 'action=browse' page. Index: browse.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** browse.html 2001/02/14 22:02:05 1.13 --- browse.html 2001/02/15 21:35:03 1.14 *************** *** 6,9 **** --- 6,10 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + ###ROBOTS_META### <base href="###BASE_URL###"> <title>###PAGE###</title> Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** editpage.html 2001/02/15 19:32:55 1.14 --- editpage.html 2001/02/15 21:35:03 1.15 *************** *** 6,9 **** --- 6,10 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + ###ROBOTS_META### <base href="###BASE_URL###"> <title>###PAGE###</title> Index: message.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/message.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** message.html 2001/02/14 22:02:05 1.8 --- message.html 2001/02/15 21:35:03 1.9 *************** *** 6,9 **** --- 6,10 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + ###ROBOTS_META### <base href="###BASE_URL###"> <title>###PAGE###</title> |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 21:34:20
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv29121/lib Modified Files: stdlib.php Log Message: New template token ###ROBOTS_META### to (attempt to) keep robots from indexing pages other than the 'action=browse' page. Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** stdlib.php 2001/02/15 19:32:55 1.32 --- stdlib.php 2001/02/15 21:35:03 1.33 *************** *** 564,567 **** --- 564,576 ---- else _dotoken('BASE_URL', SERVER_URL . SCRIPT_NAME, $page); + + if ($GLOBALS['action'] != 'browse') + _dotoken('ROBOTS_META', + Element('meta', array('name' => 'robots', + 'content' => 'noindex, nofollow')), + $page); + else + _dotoken('ROBOTS_META', '', $page); + // invalid for messages (search results, error messages) |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 21:32:57
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv28998/lib Modified Files: editpage.php Log Message: When creating default contents for non-existant pages, put [brackets] around page names which aren't BumpyWords. Index: editpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/editpage.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** editpage.php 2001/02/14 05:22:49 1.13 --- editpage.php 2001/02/15 21:33:40 1.14 *************** *** 38,43 **** } } else { ! $textarea = sprintf(gettext ("Describe %s here."), ! htmlspecialchars($pagename)); unset($pagehash); $pagehash["version"] = 0; --- 38,49 ---- } } else { ! if (preg_match("/^${WikiNameRegexp}\$/", $pagename)) ! $newpage = $pagename; ! else ! $newpage = "[$pagename]"; ! ! $textarea = htmlspecialchars( ! sprintf(gettext ("Describe %s here."), $newpage)); ! unset($pagehash); $pagehash["version"] = 0; |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 21:32:23
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv28882 Modified Files: phpwiki.css Log Message: Remove alternate colors for links, per Steve's request. Index: phpwiki.css =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/phpwiki.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** phpwiki.css 2001/02/14 05:22:49 1.1 --- phpwiki.css 2001/02/15 21:33:06 1.2 *************** *** 70,76 **** .footnote-rev { ! text-decoration: none; ! color: #600; } /* --- 70,82 ---- .footnote-rev { ! text-decoration: none; ! /* color: #600; */ } + .wikiunknown, + .wikiunknown U + { + color: #600; + } + /* *************** *** 102,110 **** .wikilink:link { ! color: #c00; } .wikilink:visited, { ! color: #600; } --- 108,116 ---- .wikilink:link { ! /* color: #c00; */ } .wikilink:visited, { ! /* color: #600; */ } |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 21:24:19
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv27660/lib Modified Files: Tag: release-1_2-branch editpage.php Log Message: When creating the default contents for non-existant pages, put [brackets] around page names which aren't BumpyWords. Index: editpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/editpage.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -r1.8 -r1.8.2.1 *** editpage.php 2001/01/01 23:13:32 1.8 --- editpage.php 2001/02/15 21:25:02 1.8.2.1 *************** *** 48,53 **** } } else { ! $textarea = sprintf(gettext ("Describe %s here."), ! htmlspecialchars($pagename)); unset($pagehash); $pagehash["version"] = 0; --- 48,59 ---- } } else { ! if (preg_match("/^${WikiNameRegexp}\$/", $pagename)) ! $newpage = $pagename; ! else ! $newpage = "[$pagename]"; ! ! $textarea = htmlspecialchars( ! sprintf(gettext ("Describe %s here."), $newpage)); ! unset($pagehash); $pagehash["version"] = 0; |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 19:32:13
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv14832/templates Modified Files: editpage.html Log Message: Minor bug/warning fixes. Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** editpage.html 2001/02/14 22:02:05 1.13 --- editpage.html 2001/02/15 19:32:55 1.14 *************** *** 49,53 **** <input type="hidden" name="action" value="save"> ! <input type="hidden" name="pagename" value="###PAGEURL###"> <input type="hidden" name="editversion" value="###VERSION###"> </form> --- 49,53 ---- <input type="hidden" name="action" value="save"> ! <input type="hidden" name="pagename" value="###PAGE###"> <input type="hidden" name="editversion" value="###VERSION###"> </form> |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 19:32:13
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv14832/lib Modified Files: stdlib.php Log Message: Minor bug/warning fixes. Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** stdlib.php 2001/02/14 22:02:05 1.31 --- stdlib.php 2001/02/15 19:32:55 1.32 *************** *** 308,312 **** } ! if ($args['action'] == 'browse') unset($args['action']); --- 308,312 ---- } ! if (isset($args['action']) && $args['action'] == 'browse') unset($args['action']); |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 19:32:13
|
Update of /cvsroot/phpwiki/phpwiki/admin In directory usw-pr-cvs1:/tmp/cvs-serv14832/admin Modified Files: removepage.php Log Message: Minor bug/warning fixes. Index: removepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/removepage.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** removepage.php 2001/02/13 05:54:38 1.2 --- removepage.php 2001/02/15 19:32:55 1.3 *************** *** 12,16 **** $html .= "\n<P>"; $html .= sprintf(gettext ("Click <a href=\"%s\">here</a> to remove the page now."), ! htmlspecialchars(MakeWikiURL($pagename, array('action' => 'remove', 'verify' => 'okay')))); $html .= "\n<P>"; --- 12,16 ---- $html .= "\n<P>"; $html .= sprintf(gettext ("Click <a href=\"%s\">here</a> to remove the page now."), ! htmlspecialchars(WikiURL($pagename, array('action' => 'remove', 'verify' => 'okay')))); $html .= "\n<P>"; |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 19:31:52
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv14520/lib Modified Files: main.php Log Message: If we're expecting PATH_INFO, and don't get it, redirect to REQUEST_URI with a trailing '/' added. This is to make the index.php script look more like a 'directory', for consistencies sake. Also apparently $PATH_INFO gets magic-quoted, so un-magic that. Index: main.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** main.php 2001/02/14 22:02:05 1.3 --- main.php 2001/02/15 19:32:34 1.4 *************** *** 5,8 **** --- 5,14 ---- include "lib/userauth.php"; + if (USE_PATH_INFO && !isset($PATH_INFO)) + { + header("Location: " . SERVER_URL . $REQUEST_URI); + exit; + } + function DeducePagename () { *************** *** 12,18 **** return fix_magic_quotes_gpc($pagename); ! if (USE_PATH_INFO) if (ereg('^' . PATH_INFO_PREFIX . '(..*)$', $PATH_INFO, $m)) return $m[1]; return gettext("FrontPage"); --- 18,27 ---- return fix_magic_quotes_gpc($pagename); ! if (USE_PATH_INFO && isset($PATH_INFO)) ! { ! fix_magic_quotes_gpc($PATH_INFO); if (ereg('^' . PATH_INFO_PREFIX . '(..*)$', $PATH_INFO, $m)) return $m[1]; + } return gettext("FrontPage"); |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 19:27:54
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv14262/templates Modified Files: Tag: release-1_2-branch editpage.html Log Message: Arguments to <input> tag should not be urlencoded(). Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -r1.6 -r1.6.2.1 *** editpage.html 2000/11/08 15:50:57 1.6 --- editpage.html 2001/02/15 19:28:36 1.6.2.1 *************** *** 39,43 **** </small> ! <input type="hidden" name="post" value="###PAGEURL###"> <input type="hidden" name="editversion" value="###VERSION###"> </form> --- 39,43 ---- </small> ! <input type="hidden" name="post" value="###PAGE###"> <input type="hidden" name="editversion" value="###VERSION###"> </form> |
From: Geoffrey T. D. <da...@us...> - 2001-02-15 05:56:38
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv21734/lib Modified Files: config.php Log Message: Fixed (I think) SF bug #132469. The problem was that the value for VIRTUAL_PATH being auto-deduced by lib/config.php was wrong. Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** config.php 2001/02/14 22:02:05 1.32 --- config.php 2001/02/15 05:57:18 1.33 *************** *** 121,127 **** define('USE_PATH_INFO', ereg('\.(php3?|cgi)$', $SCRIPT_NAME)); } if (!defined('VIRTUAL_PATH')) { ! if (USE_PATH_INFO and isset($REDIRECT_URL)) { // FIXME: This is a hack, and won't work if the requested --- 121,167 ---- define('USE_PATH_INFO', ereg('\.(php3?|cgi)$', $SCRIPT_NAME)); } + + + function IsProbablyRedirectToIndex () + { + // This might be a redirect to the DirectoryIndex, + // e.g. REQUEST_URI = /dir/ got redirected + // to SCRIPT_NAME = /dir/index.php + + // In this case, the proper virtual path is still + // $SCRIPT_NAME, since pages appear at + // e.g. /dir/index.php/FrontPage. + + global $REQUEST_URI, $SCRIPT_NAME; + + $requri = preg_quote($REQUEST_URI, '%'); + return preg_match("%^${requri}[^/]*$%", $SCRIPT_NAME); + } + + if (!defined('VIRTUAL_PATH')) { ! // We'd like to auto-detect when the cases where apaches ! // 'Action' directive (or similar means) is used to ! // redirect page requests to a cgi-handler. ! // ! // In cases like this, requests for e.g. /wiki/FrontPage ! // get redirected to a cgi-script called, say, ! // /path/to/wiki/index.php. The script gets all ! // of /wiki/FrontPage as it's PATH_INFO. ! // ! // The problem is: ! // How to detect when this has happened reliably? ! // How to pick out the "virtual path" (in this case '/wiki')? ! // ! // (Another time an redirect might occur is to a DirectoryIndex ! // -- the requested URI is '/wikidir/', the request gets ! // passed to '/wikidir/index.php'. In this case, the ! // proper VIRTUAL_PATH is '/wikidir/index.php', since the ! // pages will appear at e.g. '/wikidir/index.php/FrontPage'. ! // ! ! if (USE_PATH_INFO and isset($REDIRECT_URL) ! and ! IsProbablyRedirectToIndex()) { // FIXME: This is a hack, and won't work if the requested |
From: Geoffrey T. D. <da...@us...> - 2001-02-14 22:01:26
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv9783/lib Modified Files: config.php diff.php interwiki.php loadsave.php main.php prepend.php stdlib.php Log Message: Various minor bug fixes and cleanups. Also added the following new minor featurelets: Comments in index.php indicating how to set the PHP include_path if necessary. New config variable $DisabledActions --- one can list actions (eg. dumpserial) which should not be allowed, even by the administrator. Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** config.php 2001/02/13 05:54:38 1.31 --- config.php 2001/02/14 22:02:05 1.32 *************** *** 27,30 **** --- 27,77 ---- // Set up localization // + + if (empty($LANG)) + $LANG = "C"; + + + // Search PHP's include_path to find file or directory. + function FindFile ($file, $missing_okay = false) + { + // FIXME: This wont work for DOS filenames. + if (ereg('^/', $file)) + { + // absolute path. + if (file_exists($file)) + return $file; + } + else + { + $include_path = ini_get('include_path'); + if (empty($include_path)) + $include_path = '.'; + // FIXME: This wont work for DOS filenames. + $path = explode(':', $include_path); + while (list($i, $dir) = each ($path)) + if (file_exists("$dir/$file")) + return "$dir/$file"; + } + + if (!$missing_okay) + ExitWiki("$file: file not found"); + return false; + } + + // Search PHP's include_path to find file or directory. + // Searches for "locale/$LANG/$file", then for "$file". + function FindLocalizedFile ($file, $missing_okay = false) + { + global $LANG; + + // FIXME: This wont work for DOS filenames. + if (!ereg('^/', $file)) + { + if ( ($path = FindFile("locale/$LANG/$file", 'missing_is_okay')) ) + return $path; + } + return FindFile($file, $missing_okay); + } + if (!function_exists ('gettext')) { *************** *** 38,42 **** } ! if ( ($lcfile = SearchPath("LC_MESSAGES/phpwiki.php", 'missing_ok')) ) { include($lcfile); --- 85,89 ---- } ! if ( ($lcfile = FindLocalizedFile("LC_MESSAGES/phpwiki.php", 'missing_ok')) ) { include($lcfile); *************** *** 69,73 **** * php script is...) */ ! define('USE_PATH_INFO', ereg('\.(php3?|cgi)$', $SCRIPT_NAME)); } if (!defined('VIRTUAL_PATH')) --- 116,123 ---- * php script is...) */ ! if (php_sapi_name() == 'apache') ! define('USE_PATH_INFO', true); ! else ! define('USE_PATH_INFO', ereg('\.(php3?|cgi)$', $SCRIPT_NAME)); } if (!defined('VIRTUAL_PATH')) Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** diff.php 2001/02/13 05:54:38 1.8 --- diff.php 2001/02/14 22:02:05 1.9 *************** *** 934,938 **** $line = rtrim($line); $line = empty($line) ? ' ' : htmlspecialchars($line); ! $html .= Element('tr', $prefix . Element('td', array('bgcolor' => $color), Element('tt', $line))); --- 934,938 ---- $line = rtrim($line); $line = empty($line) ? ' ' : htmlspecialchars($line); ! $html .= Element('tr', array('valign' => 'top'), $prefix . Element('td', array('bgcolor' => $color), Element('tt', $line))); *************** *** 975,979 **** 'bgcolor' => 'white', 'cellspacing' => 0, ! 'cellpadding' => 4, 'border' => 0), $header. $diff))); --- 975,979 ---- 'bgcolor' => 'white', 'cellspacing' => 0, ! 'cellpadding' => 1, 'border' => 0), $header. $diff))); Index: interwiki.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/interwiki.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** interwiki.php 2001/02/14 05:22:49 1.3 --- interwiki.php 2001/02/14 22:02:05 1.4 *************** *** 5,9 **** global $interwikimap_file, $InterWikiLinkRegexp, $interwikimap; ! $intermap_data = file(INTERWIKI_MAP_FILE); $wikiname_regexp = ""; for ($i=0; $i<count($intermap_data); $i++) --- 5,9 ---- global $interwikimap_file, $InterWikiLinkRegexp, $interwikimap; ! $intermap_data = file(INTERWIKI_MAP_FILE, 1); $wikiname_regexp = ""; for ($i=0; $i<count($intermap_data); $i++) *************** *** 25,31 **** global $interwikimap; ! list( $wiki, $page ) = split( ":", $link ); ! $url = $interwikimap[$wiki] . urlencode($page); if ($linktext) --- 25,31 ---- global $interwikimap; ! list( $wiki, $page ) = split( ":", $link, 2 ); ! $url = $interwikimap[$wiki] . rawurlencode($page); if ($linktext) *************** *** 45,50 **** function wtt_interwikilinks($match, &$trfrm) { - global $InterWikiLinkRegexp, $WikiNameRegexp; - if ($match[0] == "!") return htmlspecialchars(substr($match,1)); --- 45,48 ---- Index: loadsave.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/loadsave.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** loadsave.php 2001/02/14 05:22:49 1.3 --- loadsave.php 2001/02/14 22:02:05 1.4 *************** *** 375,381 **** $ignore = array(gettext('RecentChanges')); ! LoadAny($dbi, SearchPath(WIKI_PGSRC), false, $ignore); if ($LANG != "C") ! LoadAny($dbi, SearchPath(DEFAULT_WIKI_PGSRC), $GenericPages, $ignore); echo "</dl>\n"; --- 375,381 ---- $ignore = array(gettext('RecentChanges')); ! LoadAny($dbi, FindLocalizedFile(WIKI_PGSRC), false, $ignore); if ($LANG != "C") ! LoadAny($dbi, FindLocalizedFile(DEFAULT_WIKI_PGSRC), $GenericPages, $ignore); echo "</dl>\n"; Index: main.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** main.php 2001/02/13 05:54:38 1.2 --- main.php 2001/02/14 22:02:05 1.3 *************** *** 5,9 **** include "lib/userauth.php"; - function DeducePagename () { --- 5,8 ---- *************** *** 14,18 **** if (USE_PATH_INFO) ! if (ereg('^' . PATH_INFO_PREFIX . '(.*)$', $PATH_INFO, $m)) return $m[1]; --- 13,17 ---- if (USE_PATH_INFO) ! if (ereg('^' . PATH_INFO_PREFIX . '(..*)$', $PATH_INFO, $m)) return $m[1]; *************** *** 39,43 **** } - function IsSafeAction ($action) { --- 38,41 ---- *************** *** 82,91 **** if (!IsSafeAction($action)) $user->must_be_admin($action); ! // Enable the output of most of the warning messages. // The warnings will screw up zip files and setpref though. if ($action != 'zip' && $action != 'setprefs') PostponeErrorMessages(E_NOTICE); ! switch ($action) { case 'edit': --- 80,91 ---- if (!IsSafeAction($action)) $user->must_be_admin($action); ! if (isset($DisabledActions) && in_array($action, $DisabledActions)) ! ExitWiki(gettext("Action $action is disabled in this wiki.")); ! // Enable the output of most of the warning messages. // The warnings will screw up zip files and setpref though. if ($action != 'zip' && $action != 'setprefs') PostponeErrorMessages(E_NOTICE); ! switch ($action) { case 'edit': Index: prepend.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/prepend.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** prepend.php 2001/02/14 05:22:49 1.2 --- prepend.php 2001/02/14 22:02:05 1.3 *************** *** 114,136 **** PostponeErrorMessages(E_ALL); - - function SearchPath ($file, $missing_ok = false, $path = false) - { - if (ereg('^/', $file)) - return $file; // absolute path. - - if (!$path) - $path = $GLOBALS['DataPath']; - - while (list($i, $dir) = each($path)) - { - if (file_exists("$dir/$file")) - return "$dir/$file"; - } - if ($missing_ok) - return false; - ExitWiki("$file: file not found"); - } - // For emacs users // Local Variables: --- 114,117 ---- Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** stdlib.php 2001/02/14 05:22:49 1.30 --- stdlib.php 2001/02/14 22:02:05 1.31 *************** *** 525,529 **** } ! $page = join('', file(SearchPath($templates[$template]))); $page = str_replace('###', "$FieldSeparator#", $page); --- 525,529 ---- } ! $page = join('', file(FindLocalizedFile($templates[$template]))); $page = str_replace('###', "$FieldSeparator#", $page); |
From: Geoffrey T. D. <da...@us...> - 2001-02-14 22:01:26
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv9783/templates Modified Files: browse.html editpage.html message.html Log Message: Various minor bug fixes and cleanups. Also added the following new minor featurelets: Comments in index.php indicating how to set the PHP include_path if necessary. New config variable $DisabledActions --- one can list actions (eg. dumpserial) which should not be allowed, even by the administrator. Index: browse.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** browse.html 2001/02/14 05:22:49 1.12 --- browse.html 2001/02/14 22:02:05 1.13 *************** *** 6,10 **** --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> --- 6,10 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <base href="###BASE_URL###"> <title>###PAGE###</title> <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** editpage.html 2001/02/14 05:22:49 1.12 --- editpage.html 2001/02/14 22:02:05 1.13 *************** *** 6,10 **** --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> --- 6,10 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <base href="###BASE_URL###"> <title>###PAGE###</title> <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> *************** *** 30,34 **** Please <a class="wikilink" href="###BROWSE###ConvertSpacesToTabs"><span class="wikiword">ConvertSpacesToTabs</span></a> for me when I save. ! <p><a class="wikilink" href="###BROWSE###GoodStyle"><span class="wikiword">GoodStyle</span></a> tips for editing. ###IF COPY###<br><a class="wikiaction" href="###ACTION###edit&version=archive">EditCopy</a> from previous author --- 30,36 ---- Please <a class="wikilink" href="###BROWSE###ConvertSpacesToTabs"><span class="wikiword">ConvertSpacesToTabs</span></a> for me when I save. ! <p>You can change the size of the editing area. ! See <a class="wikilink" href="###BROWSE###UserPreferences"><span class="wikiword">UserPreferences</span></a>.</p> ! <p><a class="wikilink" href="###BROWSE###GoodStyle"><span class="wikiword">GoodStyle</span></a> tips for editing.</p> ###IF COPY###<br><a class="wikiaction" href="###ACTION###edit&version=archive">EditCopy</a> from previous author Index: message.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/message.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** message.html 2001/02/14 05:22:49 1.7 --- message.html 2001/02/14 22:02:05 1.8 *************** *** 6,10 **** --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> --- 6,10 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <base href="###BASE_URL###"> <title>###PAGE###</title> <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> |
From: Geoffrey T. D. <da...@us...> - 2001-02-14 22:01:25
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv9783 Modified Files: index.php Log Message: Various minor bug fixes and cleanups. Also added the following new minor featurelets: Comments in index.php indicating how to set the PHP include_path if necessary. New config variable $DisabledActions --- one can list actions (eg. dumpserial) which should not be allowed, even by the administrator. Index: index.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/index.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** index.php 2001/02/14 05:22:49 1.9 --- index.php 2001/02/14 22:02:05 1.10 *************** *** 1,6 **** <?php ///////////////////////////////////////////////////////////////////// ! // Part Zero: Don't touch this! ///////////////////////////////////////////////////////////////////// define ('PHPWIKI_VERSION', '1.3.0pre'); require "lib/prepend.php"; --- 1,13 ---- <?php ///////////////////////////////////////////////////////////////////// ! // Part Zero: If PHP needs help in finding where you installed the ! // rest of the PhpWiki code, you can set the include_path here. ///////////////////////////////////////////////////////////////////// + + //ini_set('include_path', '.:/where/you/installed/phpwiki'); + + ///////////////////////////////////////////////////////////////////// + // Part Null: Don't touch this! + ///////////////////////////////////////////////////////////////////// define ('PHPWIKI_VERSION', '1.3.0pre'); require "lib/prepend.php"; *************** *** 35,38 **** --- 42,48 ---- define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600); + // Actions listed in this array will not be allowed. + //$DisabledActions = array('dumpserial', 'loadfile'); + ///////////////////////////////////////////////////////////////////// // *************** *** 121,128 **** define("NUM_RELATED_PAGES", 5); - // This path is searched when trying to read WIKI_PGSRC - // or template files. - $DataPath = array(".", "locale/$LANG"); - // Template files (filenames are relative to script position) // (These filenames will be passed through gettext() before use.) --- 131,134 ---- *************** *** 130,134 **** "EDITPAGE" => "templates/editpage.html", "MESSAGE" => "templates/message.html"); - /* WIKI_PGSRC -- specifies the source for the initial page contents --- 136,139 ---- |
From: Geoffrey T. D. <da...@us...> - 2001-02-14 06:31:41
|
Update of /cvsroot/phpwiki/phpwiki/admin In directory usw-pr-cvs1:/tmp/cvs-serv10034/admin Modified Files: Tag: release-1_2-branch dumpserial.php loadserial.php Log Message: Added extra paranoid security checks. Without these checks, if the admin directory is not protected (e.g. via .htaccess) then loadserial.php and dumpserial.php can be run directly and used to probe for and create directories on the http server. Index: dumpserial.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/Attic/dumpserial.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** dumpserial.php 2000/11/08 15:30:16 1.1 --- dumpserial.php 2001/02/14 06:32:19 1.1.2.1 *************** *** 6,10 **** directory as serialized data structures. */ ! $directory = $dumpserial; $pages = GetAllWikiPagenames($dbi); --- 6,12 ---- directory as serialized data structures. */ ! if (!defined('WIKI_ADMIN')) ! die("You must be logged in as the administrator to dump serialized pages."); ! $directory = $dumpserial; $pages = GetAllWikiPagenames($dbi); Index: loadserial.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/Attic/loadserial.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** loadserial.php 2000/11/08 15:30:16 1.1 --- loadserial.php 2001/02/14 06:32:19 1.1.2.1 *************** *** 5,8 **** --- 5,10 ---- wiki_dumpserial.php. */ + if (!defined('WIKI_ADMIN')) + die("You must be logged in as the administrator to load serialized pages."); $directory = $loadserial; |
From: Geoffrey T. D. <da...@us...> - 2001-02-14 05:22:11
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv4186/templates Modified Files: browse.html editpage.html message.html Log Message: log Index: browse.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** browse.html 2001/02/13 05:54:38 1.11 --- browse.html 2001/02/14 05:22:49 1.12 *************** *** 8,60 **** <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> ! <!-- <link rel="stylesheet" title="phpwiki" href="" type="text/css"> --> ! <style type="text/css"> ! <!-- ! .wikiword, .unknownwikiword { ! font-family: sans-serif; ! font-size: 12pt; ! text-decoration: none; ! /* background-color: #e8e8d8 */ ! } ! ! .wikiword:link { ! color: #c00 ; ! } ! .wikiword:visited { ! color: #600; ! } ! .unknownwikiword { color: #000; background-color: #ddc } ! A.unknownwikiword { color: ivory; background-color: #663333 } ! ! --> ! </style> </head> <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" align=middle width=50 height=50></a> ! <a href="###ACTION###search&searchtype=full&searchterm=###PAGEURL###">###PAGE###</a></h1> ###IF:!ANONYMOUS### <p>You are logged in as <em>###USERID###</em>. ! [<a href="###ACTION###logout">Log Out</a>]</p> ###IF:ADMIN### ! ###IF LOCK###[<a href="###ACTION###unlock">Unlock page</a>] ! ###IF !LOCK###[<a href="###ACTION###lock">Lock page</a>] - - ! [<a href="###ACTION###remove">Remove page</a>] ###ENDIF:ADMIN### <hr noshade> ###ENDIF:!ANONYMOUS### ! <P> ! ###CONTENT### <hr noshade> ! ###IF ADMIN###<a href="###ACTION###edit">EditText</a> of this page ###IF:!ADMIN### ###IF LOCK###Page locked ! ###IF !LOCK###<a href="###ACTION###edit">EditText</a> of this page ###ENDIF:!ADMIN### (last edited ###LASTMODIFIED###) ! [<a href="###ACTION###info">info</a>] ! [<a href="###ACTION###diff">diff</a>]) <br> ! <a href="###BROWSE###FindPage">FindPage</a> by browsing or searching <hr noshade> <small>###RELATEDPAGES###</small> --- 8,46 ---- <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> ! <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> </head> <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a class="wikilink" href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" align=middle width=50 height=50></a> ! <a class='wikiaction' ! href="###ACTION###search&searchtype=full&searchterm=###PAGEURL###" ! ><span class='wikiword'>###PAGE###</span></a></h1> ###IF:!ANONYMOUS### <p>You are logged in as <em>###USERID###</em>. ! [<a class="wikiaction" href="###ACTION###logout">Log Out</a>]</p> ###IF:ADMIN### ! ###IF LOCK###[<a class="wikiadmin" href="###ACTION###unlock">Unlock page</a>] ! ###IF !LOCK###[<a class="wikiadmin" href="###ACTION###lock">Lock page</a>] - - ! [<a class="wikiadmin" href="###ACTION###remove">Remove page</a>] ###ENDIF:ADMIN### <hr noshade> ###ENDIF:!ANONYMOUS### ! <table class="outer" width="100%" cellspacing=2 border=0> ! <tr><td><table class="inner" width="100%" border=0 cellspacing=0 cellpadding=5> ! <tr><td class="wikitext">###CONTENT###</td></tr> ! </table></td></tr> ! </table> <hr noshade> ! ###IF ADMIN###<a class="wikiaction" href="###ACTION###edit">EditText</a> of this page ###IF:!ADMIN### ###IF LOCK###Page locked ! ###IF !LOCK###<a class="wikiaction" href="###ACTION###edit">EditText</a> of this page ###ENDIF:!ADMIN### (last edited ###LASTMODIFIED###) ! [<a class="wikiaction" href="###ACTION###info">info</a>] ! [<a class="wikiaction" href="###ACTION###diff">diff</a>]) <br> ! <a class="wikilink" href="###BROWSE###FindPage"><span class="wikiword">FindPage</span></a> ! by browsing or searching <hr noshade> <small>###RELATEDPAGES###</small> Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** editpage.html 2001/02/13 05:54:38 1.11 --- editpage.html 2001/02/14 05:22:49 1.12 *************** *** 8,19 **** <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> </head> ! <body> ! ! <form method="POST" action="###BROWSE_PAGE###"> ! ! <h1><a href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> ! Edit ###PAGE### <input type="submit" value=" Save "></h1> --- 8,18 ---- <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> + <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> </head> ! <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> ! <form class="wikiaction" method="POST" action="###BROWSE_PAGE###"> ! <h1><a class="wikilink" href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> ! Edit <span="wikiword">###PAGE###</span> <input type="submit" value=" Save "></h1> *************** *** 29,37 **** <input type="checkbox" name="convert" value="tabs" > I can't type tabs. ! Please <a href="###BROWSE###ConvertSpacesToTabs">ConvertSpacesToTabs</a> for me when I save. ! <p><a href="###BROWSE###GoodStyle">GoodStyle</a> tips for editing. ! ###IF COPY###<br><a href="###ACTION###edit&version=archive">EditCopy</a> from previous author <hr noshade> --- 28,36 ---- <input type="checkbox" name="convert" value="tabs" > I can't type tabs. ! Please <a class="wikilink" href="###BROWSE###ConvertSpacesToTabs"><span class="wikiword">ConvertSpacesToTabs</span></a> for me when I save. ! <p><a class="wikilink" href="###BROWSE###GoodStyle"><span class="wikiword">GoodStyle</span></a> tips for editing. ! ###IF COPY###<br><a class="wikiaction" href="###ACTION###edit&version=archive">EditCopy</a> from previous author <hr noshade> *************** *** 44,48 **** "%%%" makes a linebreak, "- - - -" makes a horizontal rule, escape "[" with "[[" <br>more on ! <a href="###BROWSE###?TextFormattingRules"><b>TextFormattingRules</b></a> </small> --- 43,47 ---- "%%%" makes a linebreak, "- - - -" makes a horizontal rule, escape "[" with "[[" <br>more on ! <a class="wikilink" href="###BROWSE###TextFormattingRules"><b><span class="wikiword">TextFormattingRules</span></b></a> </small> Index: message.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/message.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** message.html 2001/02/13 05:54:38 1.6 --- message.html 2001/02/14 05:22:49 1.7 *************** *** 8,16 **** <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> </head> <body bgcolor=linen text=black alink=red link=darkblue vlink=darkmagenta> ! ! <h1><a href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> ###PAGE###</h1> --- 8,16 ---- <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> + <link rel="stylesheet" title="phpwiki" href="###CSS_URL###" type="text/css"> </head> <body bgcolor=linen text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a class="wikilink" href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> ###PAGE###</h1> |
From: Geoffrey T. D. <da...@us...> - 2001-02-14 05:22:11
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory usw-pr-cvs1:/tmp/cvs-serv4186/pgsrc Modified Files: TextFormattingRules Removed Files: RecentChanges Log Message: log Index: TextFormattingRules =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/TextFormattingRules,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** TextFormattingRules 2001/02/10 22:15:08 1.11 --- TextFormattingRules 2001/02/14 05:22:49 1.12 *************** *** 53,61 **** * You can name the links by providing a name, a bar (|) and then the hyperlink or pagename: [PhpWiki home page | http://phpwiki.sourceforge.net/] - [the front page | FrontPage] * You can suppress linking to old-style references and URIs by preceding the word with a '!', e.g. !NotLinkedAsWikiName, !http://not.linked.to/ ! * You can create footnotes by using [[1], [[2], [[3], ... like this here [1]. See footnote for counterpart. * Also, the old way of linking URL's is still supported: precede URLs with "http:", "ftp:" or "mailto:" to create links automatically as in: http://c2.com/ * URLs ending with .png, .gif, or .jpg are inlined if in square brackets, by themselves: [http://phpwiki.sourceforge.net/phpwiki/images/png.png] ! HTML Mark-Up Language --- 53,76 ---- * You can name the links by providing a name, a bar (|) and then the hyperlink or pagename: [PhpWiki home page | http://phpwiki.sourceforge.net/] - [the front page | FrontPage] * You can suppress linking to old-style references and URIs by preceding the word with a '!', e.g. !NotLinkedAsWikiName, !http://not.linked.to/ ! * You can create footnotes by using [[1], [[2], [[3], ... like this here [1]. See footnote for counterpart. (If the [[ is in the first column, it is a footnote ''definition'' rather than a footnote ''reference'' [1].) * Also, the old way of linking URL's is still supported: precede URLs with "http:", "ftp:" or "mailto:" to create links automatically as in: http://c2.com/ * URLs ending with .png, .gif, or .jpg are inlined if in square brackets, by themselves: [http://phpwiki.sourceforge.net/phpwiki/images/png.png] + ! Tables + * Simple tables are available. A table row is introduced by a __|__ in the first column. It is best described by example: + || _''''_Name_''''_ |v _''''_Cost_''''_ |v _''''_Notes_''''_ + | _''''_First_''''_ | _''''_Last_''''_ + |> Jeff |< Dairiki |^ Cheap |< Not worth it + |> Marco |< Polo | Cheaper |< Not available + ;: will generate + || __Name__ |v __Cost__ |v __Notes__ + | __First__ | __Last__ + |> Jeff |< Dairiki |^ Cheap |< Not worth it + |> Marco |< Polo | Cheaper |< Not available + + ;: Note that multiple __|__'s lead to spanned columns, and __v__'s can be used to span rows. A __>__ generates a right justified column, __<__ a left justified column and __^__ a centered column (which is the default.) + + ! HTML Mark-Up Language *************** *** 67,71 **** ! More detail than you want to know ! See MagicPhpWikiURLs for gory details on how to write various kind of wiki maintainance links. --- 82,86 ---- ! More detail than you want to know ! See [MagicPhpWikiURLs] for gory details on how to write various kind of wiki maintainance links. *************** *** 74,76 **** Footnotes: ! [1] By using [[1] a second time the footnote itself is defined. --- 89,91 ---- Footnotes: ! [1] By using [[1] a second time (in the first column) the footnote itself is ''defined''. You may refer to a footnote as many times as you want, but you may only define it once on the page. Note the the [[1] in the footnote links back to the first reference, if there are multiple references there will be +'s after the [[1] which will link to the other references. (References which come ''after'' the footnote ''definition'' will not be linked to.) --- RecentChanges DELETED --- |
From: Geoffrey T. D. <da...@us...> - 2001-02-14 05:22:11
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv4186/lib Modified Files: editpage.php interwiki.php loadsave.php prepend.php savepage.php stdlib.php transform.php Log Message: log Index: editpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/editpage.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** editpage.php 2001/02/13 05:54:38 1.12 --- editpage.php 2001/02/14 05:22:49 1.13 *************** *** 68,72 **** 'name' => 'minor_edit', 'value' => 'yes', ! 'checked' => ($do_archive == 'probably'))); } --- 68,72 ---- 'name' => 'minor_edit', 'value' => 'yes', ! 'checked' => ($do_archive == 'maybe'))); } Index: interwiki.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/interwiki.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** interwiki.php 2001/02/12 01:43:10 1.2 --- interwiki.php 2001/02/14 05:22:49 1.3 *************** *** 26,57 **** list( $wiki, $page ) = split( ":", $link ); ! $url = $interwikimap[$wiki] . urlencode($page); ! return LinkURL($url, $linktext ? $linktext : $link); } // Link InterWiki links // These can be protected by a '!' like Wiki words. ! function wtt_interwikilinks($line, &$trfrm) { global $InterWikiLinkRegexp, $WikiNameRegexp; - - $n = $ntok = $trfrm->tokencounter; - - // FIXME: perhaps WikiNameRegexp is a bit too restrictive? - $line = wt_tokenize($line, "!?(?<![A-Za-z0-9])$InterWikiLinkRegexp:$WikiNameRegexp", - $trfrm->replacements, $ntok); - while ($n < $ntok) { - $old = $trfrm->replacements[$n]; - if ($old[0] == '!') { - $trfrm->replacements[$n] = substr($old,1); - } else { - $trfrm->replacements[$n] = LinkInterWikiLink($old); - } - $n++; - } ! $trfrm->tokencounter = $ntok; ! return $line; } --- 26,53 ---- list( $wiki, $page ) = split( ":", $link ); ! $url = $interwikimap[$wiki] . urlencode($page); ! ! if ($linktext) ! $linktext = htmlspecialchars($linktext); ! else ! $linktext = Element('span', array('class' => 'interwiki'), ! htmlspecialchars("$wiki:") . ! QElement('span', array('class' => 'wikiword'), $page)); ! ! return Element('a', array('href' => $url, ! 'class' => 'interwikilink'), ! $linktext); } // Link InterWiki links // These can be protected by a '!' like Wiki words. ! function wtt_interwikilinks($match, &$trfrm) { global $InterWikiLinkRegexp, $WikiNameRegexp; ! if ($match[0] == "!") ! return htmlspecialchars(substr($match,1)); ! return LinkInterWikiLink($match); } Index: loadsave.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/loadsave.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** loadsave.php 2001/02/13 05:54:38 1.2 --- loadsave.php 2001/02/14 05:22:49 1.3 *************** *** 373,379 **** echo "<dl>\n"; ! LoadAny($dbi, SearchPath(WIKI_PGSRC)); if ($LANG != "C") ! LoadAny($dbi, SearchPath(DEFAULT_WIKI_PGSRC), $GenericPages); echo "</dl>\n"; --- 373,381 ---- echo "<dl>\n"; ! $ignore = array(gettext('RecentChanges')); ! ! LoadAny($dbi, SearchPath(WIKI_PGSRC), false, $ignore); if ($LANG != "C") ! LoadAny($dbi, SearchPath(DEFAULT_WIKI_PGSRC), $GenericPages, $ignore); echo "</dl>\n"; Index: prepend.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/prepend.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** prepend.php 2001/02/13 05:54:38 1.1 --- prepend.php 2001/02/14 05:22:49 1.2 *************** *** 2,6 **** /* lib/prepend.php * ! * Things which must be done before all else. */ $RCS_IDS = ''; --- 2,6 ---- /* lib/prepend.php * ! * Things which must be done and defined before anything else. */ $RCS_IDS = ''; *************** *** 113,116 **** --- 113,135 ---- PostponeErrorMessages(E_ALL); + + + function SearchPath ($file, $missing_ok = false, $path = false) + { + if (ereg('^/', $file)) + return $file; // absolute path. + + if (!$path) + $path = $GLOBALS['DataPath']; + + while (list($i, $dir) = each($path)) + { + if (file_exists("$dir/$file")) + return "$dir/$file"; + } + if ($missing_ok) + return false; + ExitWiki("$file: file not found"); + } // For emacs users Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** savepage.php 2001/02/13 05:54:38 1.12 --- savepage.php 2001/02/14 05:22:49 1.13 *************** *** 77,81 **** // create page header $html = sprintf(gettext("Thank you for editing %s."), ! WikiURL($pagename)); $html .= "<br>\n"; --- 77,81 ---- // create page header $html = sprintf(gettext("Thank you for editing %s."), ! LinkExistingWikiWord($pagename)); $html .= "<br>\n"; Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** stdlib.php 2001/02/13 05:54:38 1.29 --- stdlib.php 2001/02/14 05:22:49 1.30 *************** *** 42,62 **** } - function SearchPath ($file, $missing_ok = false, $path = false) - { - if (ereg('^/', $file)) - return $file; // absolute path. - - if (!$path) - $path = $GLOBALS['DataPath']; - - while (list($i, $dir) = each($path)) - { - if (file_exists("$dir/$file")) - return "$dir/$file"; - } - if ($missing_ok) - return false; - ExitWiki("$file: file not found"); - } function arrays_equal ($a, $b) --- 42,45 ---- *************** *** 70,76 **** } - - - function DataURL($url) { --- 53,56 ---- *************** *** 106,109 **** --- 86,106 ---- } + function StartTag($tag, $args = '') + { + $s = ''; + if (is_array($args)) + { + while (list($key, $val) = each($args)) + { + if (is_string($val) || is_numeric($val)) + $s .= sprintf(' %s="%s"', $key, htmlspecialchars($val)); + else if ($val) + $s .= " $key"; + } + } + return "<$tag $s>"; + } + + define('NO_END_TAG_PAT', '/^' . join('|', array('area', 'base', 'basefont', *************** *** 112,137 **** 'isindex', 'link', 'meta', 'param')) . '$/i'); ! function Element($tag, $args = '', $content = '') { $html = "<$tag"; ! if (is_array($args)) { - while (list($key, $val) = each($args)) - { - if (is_string($val) || is_numeric($val)) - $html .= sprintf(' %s="%s"', $key, htmlspecialchars($val)); - else if ($val) - $html .= " $key"; - } - } - else $content = $args; ! ! $html .= '>'; if (!preg_match(NO_END_TAG_PAT, $tag)) { $html .= $content; ! $html .= "</$tag>\n";//FIXME: newline might not always be desired. } return $html; --- 109,126 ---- 'isindex', 'link', 'meta', 'param')) . '$/i'); ! function Element($tag, $args = '', $content = '') { $html = "<$tag"; ! if (!is_array($args)) { $content = $args; ! $args = false; ! } ! $html = StartTag($tag, $args); if (!preg_match(NO_END_TAG_PAT, $tag)) { $html .= $content; ! $html .= "</$tag>";//FIXME: newline might not always be desired. } return $html; *************** *** 154,175 **** return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } ! return QElement('a', array('href' => $url), ($linktext ? $linktext : $url)); } ! function LinkExistingWikiWord($wikiword, $linktext='', $class = 'wikiword') { return Element('a', array('href' => WikiURL($wikiword), ! 'class' => $class), ! $linktext ? $linktext : $wikiword); } ! function LinkUnknownWikiWord($wikiword, $linktext='', $class = 'unknownwikiword') { if (empty($linktext)) ! $linktext = $wikiword; ! return Element('span', array('class' => 'unknownwikiword'), ! QElement('u', array('class' => 'unknownwikiword'), $linktext) . QElement('a', array('href' => WikiURL($wikiword, array('action' => 'edit')), ! 'class' => 'unknownwikiword'), '?')); } --- 143,180 ---- return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } ! ! ! if (empty($linktext)) ! $linktext = QElement('span', array('class' => 'rawurl'), $url); ! else ! $linktext = htmlspecialchars($linktext); ! ! return Element('a', ! array('href' => $url, 'class' => 'linkurl'), ! $linktext); } ! function LinkExistingWikiWord($wikiword, $linktext='') { ! if (empty($linktext)) ! $linktext = QElement('span', array('class' => 'wikiword'), $wikiword); ! else ! $linktext = htmlspecialchars($linktext); ! return Element('a', array('href' => WikiURL($wikiword), ! 'class' => 'wikilink'), ! $linktext); } ! function LinkUnknownWikiWord($wikiword, $linktext='') { if (empty($linktext)) ! $linktext = QElement('span', array('class' => 'wikiword'), $wikiword); ! else ! $linktext = htmlspecialchars($linktext); ! return Element('span', array('class' => 'wikiunknown'), ! Element('u', $linktext) . QElement('a', array('href' => WikiURL($wikiword, array('action' => 'edit')), ! 'class' => 'wikiunknown'), '?')); } *************** *** 225,232 **** ! function MakeWikiForm ($pagename, $args, $button_text = '') { $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME; $formargs['method'] = 'post'; $contents = ''; $input_seen = 0; --- 230,239 ---- ! function MakeWikiForm ($pagename, $args, $class, $button_text = '') { $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME; $formargs['method'] = 'post'; + $formargs['class'] = $class; + $contents = ''; $input_seen = 0; *************** *** 264,268 **** return Element('form', $formargs, ! Element('table', Element('tr', $row))); } --- 271,275 ---- return Element('form', $formargs, ! Element('table', array('cellspacing' => 0, 'cellpadding' => 2, 'border' => 0), Element('tr', $row))); } *************** *** 301,320 **** } ! // FIXME: ug, don't like this ! ! if (!empty($args['action']) && !IsSafeAction($args['action'])) { // Don't allow administrative links on unlocked pages. global $pagehash; if (($pagehash['flags'] & FLAG_PAGE_LOCKED) == 0) ! return QElement('u', gettext('Lock page to enable link')); } // FIXME: ug, don't like this if (preg_match('/=\d*\(/', $qargs)) ! return MakeWikiForm($page, $args, $text); else ! return LinkURL(WikiURL($page, $args), $text ? $text : $url); } --- 308,344 ---- } + if ($args['action'] == 'browse') + unset($args['action']); ! if (empty($args['action'])) ! $class = 'wikilink'; ! else if (IsSafeAction($args['action'])) ! $class = 'wikiaction'; ! else { // Don't allow administrative links on unlocked pages. + // FIXME: Ugh: don't like this... global $pagehash; if (($pagehash['flags'] & FLAG_PAGE_LOCKED) == 0) ! return QElement('u', array('class' => 'wikiunsafe'), ! gettext('Lock page to enable link')); ! ! $class = 'wikiadmin'; } // FIXME: ug, don't like this if (preg_match('/=\d*\(/', $qargs)) ! return MakeWikiForm($page, $args, $class, $text); else ! { ! if ($text) ! $text = htmlspecialchars($text); ! else ! $text = QElement('span', array('class' => 'rawurl'), $url); ! ! return Element('a', array('href' => WikiURL($page, $args), ! 'class' => $class), ! $text); ! } } *************** *** 520,523 **** --- 544,548 ---- _dotoken('PAGE', htmlspecialchars($name), $page); _dotoken('LOGO', htmlspecialchars(DataURL($logo)), $page); + _dotoken('CSS_URL', htmlspecialchars(DataURL(CSS_URL)), $page); _dotoken('RCS_IDS', $GLOBALS['RCS_IDS'], $page); *************** *** 572,585 **** // this shouldn't be necessary, since PhpWiki loads // default pages if this is a new baby Wiki - if ($recentchanges == -1) { - $recentchanges = array(); - } - $now = time(); $today = date($dateformat, $now); if (date($dateformat, $recentchanges['lastmodified']) != $today) { $isNewDay = TRUE; - $recentchanges['lastmodified'] = $now; } else { $isNewDay = FALSE; --- 597,622 ---- // this shouldn't be necessary, since PhpWiki loads // default pages if this is a new baby Wiki $now = time(); $today = date($dateformat, $now); + if (!is_array($recentchanges)) { + $recentchanges = array('version' => 1, + 'created' => $now, + 'lastmodified' => $now - 48 * 4600, // force $isNewDay + 'flags' => FLAG_PAGE_LOCKED, + 'author' => $GLOBALS['user']->id()); + $recentchanges['content'] + = array(gettext("The most recently changed pages are listed below."), + '', + "____$today " . gettext("(first day for this Wiki)"), + '', + gettext("Quick title search:"), + '[phpwiki:?action=search&searchterm=()]', + '----'); + } + $recentchanges['lastmodified'] = $now; + if (date($dateformat, $recentchanges['lastmodified']) != $today) { $isNewDay = TRUE; } else { $isNewDay = FALSE; Index: transform.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/transform.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** transform.php 2001/02/12 01:43:10 1.15 --- transform.php 2001/02/14 05:22:49 1.16 *************** *** 1,7 **** <?php rcs_id('$Id$'); define('WT_TOKENIZER', 1); ! define('WT_SIMPLE_MARKUP', 2); ! define('WT_MODE_MARKUP', 3); define("ZERO_LEVEL", 0); --- 1,7 ---- <?php rcs_id('$Id$'); + define('WT_SIMPLE_MARKUP', 0); define('WT_TOKENIZER', 1); ! define('WT_MODE_MARKUP', 2); define("ZERO_LEVEL", 0); *************** *** 13,27 **** function WikiTransform() -- init ! function register($type, $function) Registers transformer functions This should be done *before* calling do_transform ! $type ... one of WT_TOKENIZER, WT_SIMPLE_MARKUP, WT_MODE_MARKUP ! Currently on WT_MODE_MARKUP has a special meaning. ! If one WT_MODE_MARKUP really sets the html mode, then all successive WT_MODE_MARKUP functions are skipped ! ! $function ... function name ! function SetHTMLMode($tag, $tagtype, $level) Wiki HTML output can, at any given time, be in only one mode. --- 13,35 ---- function WikiTransform() -- init ! function register($type, $function, [$regexp]) Registers transformer functions This should be done *before* calling do_transform ! $type: ! WT_MODE_MARKUP ! If one WT_MODE_MARKUP really sets the html mode, then all successive WT_MODE_MARKUP functions are skipped ! WT_TOKENIZER ! The transformer function is called once for each match ! of the $regexp in the line. The matched values are tokenized ! to protect them from further transformation. ! ! $function: function name ! ! $regexp: Required for WT_TOKENIZER functions. Optional for others. ! If given, the transformer function will only be called if the ! line matches the $regexp. ! function SetHTMLMode($tag, $tagtype, $level) Wiki HTML output can, at any given time, be in only one mode. *************** *** 32,35 **** --- 40,45 ---- $tag ... HTML tag to insert + If $tag is an array, first element give tag, second element + is a hash containing arguments for the tag. $tagtype ... ZERO_LEVEL - close all open tags before inserting $tag NESTED_LEVEL - close tags until depths match *************** *** 48,53 **** var $linenumber; // current linenumber var $replacements; // storage for tokenized strings of current line ! var $tokencounter; // counter of $replacements array ! // private variables var $content; // wiki markup, array of lines --- 58,64 ---- var $linenumber; // current linenumber var $replacements; // storage for tokenized strings of current line ! var $user_data; // can be used by the transformer functions ! // to store miscellaneous data. ! // private variables var $content; // wiki markup, array of lines *************** *** 64,70 **** // register transformation functions ! function register($type, $function) { ! $this->trfrm_func[] = array ($type, $function); } --- 75,81 ---- // register transformation functions ! function register($type, $function, $regexp = false) { ! $this->trfrm_func[] = array ($type, $function, $regexp); } *************** *** 73,80 **** function SetHTMLMode($tag, $tagtype, $level) { $this->mode_set = 1; // in order to prevent other mode markup // to be executed $retvar = ''; ! if ($tagtype == ZERO_LEVEL) { // empty the stack until $level == 0; --- 84,99 ---- function SetHTMLMode($tag, $tagtype, $level) { + if (is_array($tag)) { + $args = $tag[1]; + $tag = $tag[0]; + } + else { + $args = array(); + } + $this->mode_set = 1; // in order to prevent other mode markup // to be executed $retvar = ''; ! if ($tagtype == ZERO_LEVEL) { // empty the stack until $level == 0; *************** *** 88,92 **** if ($tag) { ! $retvar .= "<$tag>\n"; $this->stack->push($tag); } --- 107,111 ---- if ($tag) { ! $retvar .= StartTag($tag, $args) . "\n"; $this->stack->push($tag); } *************** *** 110,114 **** if ($tag != $this->stack->top()) { $closetag = $this->stack->pop(); ! $retvar .= "</$closetag><$tag>\n"; $this->stack->push($tag); } --- 129,133 ---- if ($tag != $this->stack->top()) { $closetag = $this->stack->pop(); ! $retvar .= "</$closetag>" . StartTag($tag, $args) . "\n"; $this->stack->push($tag); } *************** *** 118,122 **** // stack might be zero while ($this->stack->cnt() < $level) { ! $retvar .= "<$tag>\n"; $this->stack->push($tag); if ($this->stack->cnt() > 10) { --- 137,141 ---- // stack might be zero while ($this->stack->cnt() < $level) { ! $retvar .= StartTag($tag, $args) . "\n"; $this->stack->push($tag); if ($this->stack->cnt() > 10) { *************** *** 131,135 **** } ! return $retvar; } // end SetHTMLMode --- 150,154 ---- } ! return $this->token($retvar); } // end SetHTMLMode *************** *** 143,153 **** $this->content = $content; ! // Loop over all lines of the page and apply transformation rules $numlines = count($this->content); for ($lnum = 0; $lnum < $numlines; $lnum++) { ! $this->tokencounter = 0; ! $this->replacements = array(); $this->linenumber = $lnum; $line = $this->content[$lnum]; --- 162,173 ---- $this->content = $content; ! $this->replacements = array(); ! $this->user_data = array(); ! // Loop over all lines of the page and apply transformation rules $numlines = count($this->content); for ($lnum = 0; $lnum < $numlines; $lnum++) { ! $this->linenumber = $lnum; $line = $this->content[$lnum]; *************** *** 164,181 **** // tokenizers, markup, html mode, ... // functions are executed in order of registering ! for ($func = 0; $func < count($this->trfrm_func); $func++) { // if HTMLmode is already set then skip all following // WT_MODE_MARKUP functions ! if ($this->mode_set && ! ($this->trfrm_func[$func][0] == WT_MODE_MARKUP)) { continue; - } - // call registered function - $line = $this->trfrm_func[$func][1]($line, $this); - } ! // Replace tokens ($replacements was filled by wtt_* functions) ! for ($i = 0; $i < $this->tokencounter; $i++) { ! $line = str_replace($FieldSeparator.$FieldSeparator.$i.$FieldSeparator, $this->replacements[$i], $line); } --- 184,204 ---- // tokenizers, markup, html mode, ... // functions are executed in order of registering ! for (reset($this->trfrm_func); ! list($flags, $func, $regexp) = current($this->trfrm_func); ! next($this->trfrm_func)) { ! // if HTMLmode is already set then skip all following // WT_MODE_MARKUP functions ! if ($this->mode_set && ($flags & WT_MODE_MARKUP) != 0) continue; ! if (!empty($regexp) && !preg_match("/$regexp/", $line)) ! continue; ! ! // call registered function ! if (($flags & WT_TOKENIZER) != 0) ! $line = $this->tokenize($line, $regexp, $func); ! else ! $line = $func($line, $this); } *************** *** 185,210 **** $html .= $this->SetHTMLMode('', ZERO_LEVEL, 0); ! return $html; } // end do_transfrom() } // end class WikiTransform ! ////////////////////////////////////////////////////////// ! $transform = new WikiTransform; ! // register functions ! // functions are applied in order of registering ! $transform->register(WT_TOKENIZER, 'wtt_bracketlinks'); ! $transform->register(WT_TOKENIZER, 'wtt_urls'); ! if (function_exists('wtt_interwikilinks')) { ! $transform->register(WT_TOKENIZER, 'wtt_interwikilinks'); ! } ! $transform->register(WT_TOKENIZER, 'wtt_bumpylinks'); $transform->register(WT_SIMPLE_MARKUP, 'wtm_htmlchars'); $transform->register(WT_SIMPLE_MARKUP, 'wtm_linebreak'); --- 208,275 ---- $html .= $this->SetHTMLMode('', ZERO_LEVEL, 0); ! return $this->untokenize($html); } // end do_transfrom() + // Register a new token. + function token($repl) { + global $FieldSeparator; + $tok = $FieldSeparator . sizeof($this->replacements) . $FieldSeparator; + $this->replacements[] = $repl; + return $tok; + } + + // helper function which does actual tokenizing + function tokenize($str, $pattern, $func) { + // Find any strings in $str that match $pattern and + // store them in $orig, replacing them with tokens + // starting at number $ntokens - returns tokenized string + $new = ''; + while (preg_match("/^(.*?)($pattern)/", $str, $matches)) { + $str = substr($str, strlen($matches[0])); + $new .= $matches[1] . $this->token($func($matches[2], $this)); + } + return $new . $str; + } + + function untokenize($line) { + global $FieldSeparator; + + $chunks = explode ($FieldSeparator, "$line "); + $line = $chunks[0]; + for ($i = 1; $i < count($chunks); $i += 2) + { + $tok = $chunks[$i]; + $line .= $this->replacements[$tok] . $chunks[$i + 1]; + } + return $line; + } } // end class WikiTransform ! ////////////////////////////////////////////////////////// ! $transform = new WikiTransform; ! // register functions ! // functions are applied in order of registering ! $transform->register(WT_TOKENIZER, 'wtt_doublebrackets', '\[\['); ! $transform->register(WT_TOKENIZER, 'wtt_footnotes', '^\[\d+\]'); ! $transform->register(WT_TOKENIZER, 'wtt_footnoterefs', '\[\d+\]'); ! $transform->register(WT_TOKENIZER, 'wtt_bracketlinks', '\[.+?\]'); ! $transform->register(WT_TOKENIZER, 'wtt_urls', ! "!?\b($AllowedProtocols):[^\s<>\[\]\"'()]*[^\s<>\[\]\"'(),.?]"); ! ! if (function_exists('wtt_interwikilinks')) { ! $transform->register(WT_TOKENIZER, 'wtt_interwikilinks', ! "!?(?<![A-Za-z0-9])$InterWikiLinkRegexp:$WikiNameRegexp"); ! } ! $transform->register(WT_TOKENIZER, 'wtt_bumpylinks', "!?$WikiNameRegexp"); + if (function_exists('wtm_table')) { + $transform->register(WT_MODE_MARKUP, 'wtm_table', '^\|'); + } $transform->register(WT_SIMPLE_MARKUP, 'wtm_htmlchars'); $transform->register(WT_SIMPLE_MARKUP, 'wtm_linebreak'); *************** *** 224,228 **** $html = $transform->do_transform($html, $pagehash['content']); - /* Requirements for functions registered to WikiTransform: --- 289,292 ---- *************** *** 249,357 **** // Tokenizer functions - // helper function which does actual tokenizing and is - // called by other wtt_* functions - function wt_tokenize($str, $pattern, &$orig, &$ntokens) { - global $FieldSeparator; - // Find any strings in $str that match $pattern and - // store them in $orig, replacing them with tokens - // starting at number $ntokens - returns tokenized string - $new = ''; - while (preg_match("/^(.*?)($pattern)/", $str, $matches)) { - $linktoken = $FieldSeparator . $FieldSeparator . ($ntokens++) . $FieldSeparator; - $new .= $matches[1] . $linktoken; - $orig[] = $matches[2]; - $str = substr($str, strlen($matches[0])); - } - $new .= $str; - return $new; - } - ! // New linking scheme: links are in brackets. This will ! // emulate typical HTML linking as well as Wiki linking. ! function wtt_bracketlinks($line, &$trfrm) ! { ! static $footnotes = array(); ! // protecting [[ ! $n = $ntok = $trfrm->tokencounter; ! $line = wt_tokenize($line, '\[\[', $trfrm->replacements, $ntok); ! while ($n < $ntok) { ! $trfrm->replacements[$n++] = '['; ! } ! ! // match anything else between brackets ! $line = wt_tokenize($line, '\[.+?\]', $trfrm->replacements, $ntok); ! while ($n < $ntok) { ! $link = ParseAndLink($trfrm->replacements[$n]); ! if (strpos($link['type'], 'footnote') === false) { ! $trfrm->replacements[$n] = $link['link']; ! } else { ! $ftnt = $link['link']; ! if (isset($footnotes[$ftnt])) { ! $trfrm->replacements[$n] = "<A NAME=\"footnote-$ftnt\"></A><A HREF=\"#footnote-rev-$ftnt\">[$ftnt]</A>"; ! } else { // first encounter of [x] ! $trfrm->replacements[$n] = "<A NAME=\"footnote-rev-$ftnt\"></A><SUP><A HREF=\"#footnote-$ftnt\">[$ftnt]</A></SUP>"; ! $footnotes[$ftnt] = 1; ! } ! } ! $n++; ! } ! $trfrm->tokencounter = $ntok; ! return $line; } ! // replace all URL's with tokens, so we don't confuse them ! // with Wiki words later. Wiki words in URL's break things. ! // URLs preceeded by a '!' are not linked ! function wtt_urls($line, &$trfrm) ! { ! global $AllowedProtocols; ! $n = $ntok = $trfrm->tokencounter; ! $line = wt_tokenize($line, "!?\b($AllowedProtocols):[^\s<>\[\]\"'()]*[^\s<>\[\]\"'(),.?]", $trfrm->replacements, $ntok); ! while ($n < $ntok) { ! if($trfrm->replacements[$n][0] == '!') ! $trfrm->replacements[$n] = substr($trfrm->replacements[$n], 1); ! else ! $trfrm->replacements[$n] = LinkURL($trfrm->replacements[$n]); ! $n++; ! } ! $trfrm->tokencounter = $ntok; ! return $line; } ! - // Link Wiki words (BumpyText) - // Wikiwords preceeded by a '!' are not linked - function wtt_bumpylinks($line, &$trfrm) - { - global $WikiNameRegexp, $dbi; ! $n = $ntok = $trfrm->tokencounter; ! $line = wt_tokenize($line, "!?$WikiNameRegexp", $trfrm->replacements, $ntok); ! while ($n < $ntok) { ! $old = $trfrm->replacements[$n]; ! if ($old[0] == '!') { ! $trfrm->replacements[$n] = substr($old,1); ! } elseif (IsWikiPage($dbi, $old)) { ! $trfrm->replacements[$n] = LinkExistingWikiWord($old); ! } else { ! $trfrm->replacements[$n] = LinkUnknownWikiWord($old); ! } ! $n++; ! } ! $trfrm->tokencounter = $ntok; ! return $line; ! } ! // end of tokenizer functions ! ////////////////////////////////////////////////////////// --- 313,405 ---- // Tokenizer functions ! function wtt_doublebrackets($match, &$trfrm) ! { ! return '['; ! } ! function wtt_footnotes($match, &$trfrm) ! { ! // FIXME: should this set HTML mode? ! $ftnt = trim(substr($match,1,-1)) + 0; ! $fntext = "[$ftnt]"; ! $html = "<br>"; ! ! $fnlist = $trfrm->user_data['footnotes'][$ftnt]; ! if (!is_array($fnlist)) ! return $html . $fntext; ! ! $trfrm->user_data['footnotes'][$ftnt] = 'footnote_seen'; ! while (list($k, $anchor) = each($fnlist)) ! { ! $html .= Element("a", array("name" => "footnote-$ftnt", ! "href" => "#$anchor", ! "class" => "footnote-rev"), ! $fntext); ! $fntext = '+'; } + return $html; + } + function wtt_footnoterefs($match, &$trfrm) + { + $ftnt = trim(substr($match,1,-1)) + 0; ! $footnote_definition_seen = false; ! if (empty($trfrm->user_data['footnotes'])) ! $trfrm->user_data['footnotes'] = array(); ! if (empty($trfrm->user_data['footnotes'][$ftnt])) ! $trfrm->user_data['footnotes'][$ftnt] = array(); ! else if (!is_array($trfrm->user_data['footnotes'][$ftnt])) ! $footnote_definition_seen = true; ! ! $args['href'] = "#footnote-$ftnt"; ! if (!$footnote_definition_seen) ! { ! $args['name'] = "footrev-$ftnt-" . ! count($trfrm->user_data['footnotes'][$ftnt]); ! $trfrm->user_data['footnotes'][$ftnt][] = $args['name']; } ! ! return Element('sup', array('class' => 'footnote'), ! QElement("a", $args, "[$ftnt]")); ! } + function wtt_bracketlinks($match, &$trfrm) + { + $link = ParseAndLink($match); + return $link["link"]; + } ! // replace all URL's with tokens, so we don't confuse them ! // with Wiki words later. Wiki words in URL's break things. ! // URLs preceeded by a '!' are not linked ! function wtt_urls($match, &$trfrm) ! { ! if ($match[0] == "!") ! return htmlspecialchars(substr($match,1)); ! return LinkURL($match); ! } ! // Link Wiki words (BumpyText) ! // Wikiwords preceeded by a '!' are not linked ! function wtt_bumpylinks($match, &$trfrm) ! { ! global $dbi; ! if ($match[0] == "!") ! return htmlspecialchars(substr($match,1)); ! // FIXME: make a LinkWikiWord() function? ! if (IsWikiPage($dbi, $match)) ! return LinkExistingWikiWord($match); ! return LinkUnknownWikiWord($match); ! } ! // end of tokenizer functions ! ////////////////////////////////////////////////////////// *************** *** 491,494 **** --- 539,579 ---- return $line; } + + // markup for tables + function wtm_table($line, &$trfrm) + { + $row = ''; + while (preg_match('/^(\|+)(v*)([<>^]?)([^|]*)/', $line, $m)) + { + $line = substr($line, strlen($m[0])); + $td = array(); + + if (strlen($m[1]) > 1) + $td['colspan'] = strlen($m[1]); + if (strlen($m[2]) > 0) + $td['rowspan'] = strlen($m[2]) + 1; + + if ($m[3] == '<') + $td['align'] = 'left'; + else if ($m[3] == '>') + $td['align'] = 'right'; + else + $td['align'] = 'center'; + + $row .= $trfrm->token(StartTag('td', $td) . " "); + $row .= trim($m[4]); + $row .= $trfrm->token(" </td>"); + } + assert(empty($line)); + $row = $trfrm->token("<tr>") . $row . $trfrm->token("</tr>"); + + return $trfrm->SetHTMLMode(array('table', + array('align' => 'center', + 'cellpadding' => 1, + 'cellspacing' => 1, + 'border' => 1)), + ZERO_LEVEL, 0) . + $row; + } // four or more dashes to <hr> |