From: <var...@us...> - 2012-12-11 13:58:55
|
Revision: 8640 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8640&view=rev Author: vargenau Date: 2012-12-11 13:58:48 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Revert smart quotes Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2012-12-11 13:58:10 UTC (rev 8639) +++ trunk/lib/stdlib.php 2012-12-11 13:58:48 UTC (rev 8640) @@ -1543,7 +1543,7 @@ // literal variable name substitution only to keep locale // strings uncluttered trigger_error(sprintf(_("Can't mix “%s” with “%s” type format strings"), - '%1\$s', “%s”), E_USER_WARNING); //php+locale error + '%1\$s', '%s'), E_USER_WARNING); //php+locale error $fmt = preg_replace('/(?<!%)%\d+\$/x', '%', $fmt); $newargs = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-05-30 12:45:05
|
Revision: 8792 http://sourceforge.net/p/phpwiki/code/8792 Author: vargenau Date: 2013-05-30 12:45:03 +0000 (Thu, 30 May 2013) Log Message: ----------- Avoid warning with page containing "?" Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2013-05-30 12:42:57 UTC (rev 8791) +++ trunk/lib/stdlib.php 2013-05-30 12:45:03 UTC (rev 8792) @@ -845,9 +845,6 @@ } else { $name = $url; } - if (strstr($shortName, '?')) { - list($shortName, $dummy) = explode("\?", $shortName, 2); - } $this->shortName = $shortName; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-05-30 12:43:00
|
Revision: 8791 http://sourceforge.net/p/phpwiki/code/8791 Author: vargenau Date: 2013-05-30 12:42:57 +0000 (Thu, 30 May 2013) Log Message: ----------- Function UnMangleXmlIdentifier unused Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2013-05-29 08:17:45 UTC (rev 8790) +++ trunk/lib/stdlib.php 2013-05-30 12:42:57 UTC (rev 8791) @@ -35,7 +35,6 @@ LinkPhpwikiURL ($url, $text, $basepage) ConvertOldMarkup ($content, $markup_type = "block") MangleXmlIdentifier($str) - UnMangleXmlIdentifier($str) class Stack { push($item), pop(), cnt(), top() } class Alert { show() } @@ -145,15 +144,6 @@ $str); } -function UnMangleXmlIdentifier($str) -{ - if ($str == 'empty.') - return ''; - return preg_replace('/x(\w\w)\./e', - "sprintf('%c', hex('\\0'))", - $str); -} - /** * Returns a name for the WIKI_ID cookie that should be unique on the host. * But for it to be unique you must have set a unique WIKI_NAME in your This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-05-30 13:24:03
|
Revision: 8793 http://sourceforge.net/p/phpwiki/code/8793 Author: vargenau Date: 2013-05-30 13:23:59 +0000 (Thu, 30 May 2013) Log Message: ----------- Change MangleXmlIdentifier so that the URL does end with ".", avoiding problems in mail tool Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2013-05-30 12:45:03 UTC (rev 8792) +++ trunk/lib/stdlib.php 2013-05-30 13:23:59 UTC (rev 8793) @@ -125,7 +125,7 @@ * * It does this by * converting all bytes not in [A-Za-z0-9:_-], - * and any leading byte not in [A-Za-z] to 'xbb.', + * and any leading byte not in [A-Za-z] to '.bb', * where 'bb' is the hexadecimal representation of the * character. * @@ -136,11 +136,12 @@ */ function MangleXmlIdentifier($str) { - if (!$str) + if (!$str) { return 'empty.'; + } return preg_replace('/[^-_:A-Za-z0-9]|(?<=^)[^A-Za-z]/e', - "'x' . sprintf('%02x', ord('\\0')) . '.'", + "'.' . sprintf('%02x', ord('\\0'))", $str); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-03 13:54:37
|
Revision: 9169 http://sourceforge.net/p/phpwiki/code/9169 Author: vargenau Date: 2014-10-03 13:54:30 +0000 (Fri, 03 Oct 2014) Log Message: ----------- function mime_content_type exists Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-03 13:51:44 UTC (rev 9168) +++ trunk/lib/stdlib.php 2014-10-03 13:54:30 UTC (rev 9169) @@ -656,7 +656,7 @@ } $type = $img->getAttr('type'); if (!$type) { - if (function_exists('mime_content_type') && file_exists($url)) { + if (file_exists($url)) { $type = mime_content_type($url); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-03 14:24:24
|
Revision: 9173 http://sourceforge.net/p/phpwiki/code/9173 Author: vargenau Date: 2014-10-03 14:24:21 +0000 (Fri, 03 Oct 2014) Log Message: ----------- function memory_get_usage exists Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-03 14:19:30 UTC (rev 9172) +++ trunk/lib/stdlib.php 2014-10-03 14:24:21 UTC (rev 9173) @@ -2074,44 +2074,10 @@ /** * Return the used process memory, in bytes. - * Enable the section which will work for you. They are very slow. - * Special quirks for Windows: Requires cygwin. */ function getMemoryUsage() { - //if (!(DEBUG & _DEBUG_VERBOSE)) return; - if (function_exists('memory_get_usage') and memory_get_usage()) { - return memory_get_usage(); - } elseif (function_exists('getrusage') and ($u = @getrusage()) and !empty($u['ru_maxrss'])) { - return $u['ru_maxrss']; - } elseif (substr(PHP_OS, 0, 3) == 'WIN') { // may require a newer cygwin - // what we want is the process memory only: apache or php (if CGI) - $pid = getmypid(); - $memstr = ''; - // win32_ps_stat_proc, win32_ps_stat_mem - if (function_exists('win32_ps_list_procs')) { - $info = win32_ps_stat_proc($pid); - $memstr = $info['mem']['working_set_size']; - } elseif (0) { - // This works only if it's a cygwin process (apache or php). - // Requires a newer cygwin - $memstr = exec("cat /proc/$pid/statm |cut -f1"); - - // if it's native windows use something like this: - // (requires pslist from sysinternals.com, grep, sed and perl) - //$memstr = exec("pslist $pid|grep -A1 Mem|sed 1d|perl -ane\"print \$"."F[5]\""); - } - return (integer)trim($memstr); - } else { - $pid = getmypid(); - //%MEM: Percentage of total memory in use by this process - //VSZ: Total virtual memory size, in 1K blocks. - //RSS: Real Set Size, the actual amount of physical memory allocated to this process. - //CPU time used by process since it started. - //echo "%",`ps -o%mem,vsz,rss,time -p $pid|sed 1d`,"\n"; - $memstr = exec("ps -orss -p $pid|sed 1d"); - return (integer)trim($memstr); - } + return memory_get_usage(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-03 14:26:33
|
Revision: 9174 http://sourceforge.net/p/phpwiki/code/9174 Author: vargenau Date: 2014-10-03 14:26:30 +0000 (Fri, 03 Oct 2014) Log Message: ----------- function debug_print_backtrace exists Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-03 14:24:21 UTC (rev 9173) +++ trunk/lib/stdlib.php 2014-10-03 14:26:30 UTC (rev 9174) @@ -2057,19 +2057,8 @@ function printSimpleTrace($bt) { - //print_r($bt); echo "\nTraceback:\n"; - if (function_exists('debug_print_backtrace')) { // >= 5 - debug_print_backtrace(); - } else { - foreach ($bt as $i => $elem) { - if (!array_key_exists('file', $elem)) { - continue; - } - //echo join(" ",array_values($elem)),"\n"; - echo " ", $elem['file'], ':', $elem['line'], " ", $elem['function'], "\n"; - } - } + debug_print_backtrace(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-06 17:12:36
|
Revision: 9202 http://sourceforge.net/p/phpwiki/code/9202 Author: vargenau Date: 2014-10-06 17:12:32 +0000 (Mon, 06 Oct 2014) Log Message: ----------- Remove pagename assertion Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-06 17:09:23 UTC (rev 9201) +++ trunk/lib/stdlib.php 2014-10-06 17:12:32 UTC (rev 9202) @@ -910,13 +910,6 @@ return $page->getPageName(); elseif (isa($page, 'WikiPageName')) return $page->name; - // '0' or e.g. '1984' should be allowed though - if (!is_string($page) and !is_integer($page)) { - trigger_error(sprintf("Non-string pagename “%s” (%s)(%s)", - $page, gettype($page), get_class($page)), - E_USER_NOTICE); - } - //assert(is_string($page)); return $page; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-07 07:55:00
|
Revision: 9205 http://sourceforge.net/p/phpwiki/code/9205 Author: vargenau Date: 2014-10-07 07:54:52 +0000 (Tue, 07 Oct 2014) Log Message: ----------- Remove unused function charset_convert Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-06 17:17:24 UTC (rev 9204) +++ trunk/lib/stdlib.php 2014-10-07 07:54:52 UTC (rev 9205) @@ -83,7 +83,6 @@ extractSection ($section, $content, $page, $quiet = false, $sectionhead = false) isExternalReferrer() - charset_convert($from, $to, $data) string_starts_with($string, $prefix) string_ends_with($string, $suffix) array_remove($arr,$value) @@ -2000,25 +1999,6 @@ return extension_loaded($extension); } -function charset_convert($from, $to, $data) -{ - if (strtolower($from) == 'utf-8' and strtolower($to) == 'iso-8859-1') - return utf8_decode($data); - if (strtolower($to) == 'utf-8' and strtolower($from) == 'iso-8859-1') - return utf8_encode($data); - - if (loadPhpExtension("iconv")) { - $tmpdata = iconv($from, $to, $data); - if (!$tmpdata) - trigger_error("charset conversion $from => $to failed. Wrong source charset?", E_USER_WARNING); - else - $data = $tmpdata; - } else { - trigger_error("The iconv extension cannot be loaded", E_USER_WARNING); - } - return $data; -} - function string_starts_with($string, $prefix) { return (substr($string, 0, strlen($prefix)) == $prefix); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-07 08:27:20
|
Revision: 9207 http://sourceforge.net/p/phpwiki/code/9207 Author: vargenau Date: 2014-10-07 08:27:17 +0000 (Tue, 07 Oct 2014) Log Message: ----------- Remove unused function isUtf8String Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-07 08:05:55 UTC (rev 9206) +++ trunk/lib/stdlib.php 2014-10-07 08:27:17 UTC (rev 9207) @@ -63,7 +63,6 @@ glob_match ($glob, $against, $case_sensitive = true) explodePageList ($input, $perm = false) isa ($object, $class) - can ($object, $method) function_usable ($function_name) wikihash ($x) count_all ($arg) @@ -74,7 +73,6 @@ phpwiki_version () isWikiWord ($word) obj2hash ($obj, $exclude = false, $fields = false) - isUtf8String ($s) fixTitleEncoding ($s) url_get_contents ($uri) GenerateId ($name) @@ -1778,24 +1776,6 @@ } /** - * isUtf8String($string) - cheap utf-8 detection - * - * segfaults for strings longer than 10kb! - * Use http://www.phpdiscuss.com/article.php?id=565&group=php.i18n or - * checkTitleEncoding() at http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/Language.php - */ -function isUtf8String($s) -{ - $ptrASCII = '[\x00-\x7F]'; - $ptr2Octet = '[\xC2-\xDF][\x80-\xBF]'; - $ptr3Octet = '[\xE0-\xEF][\x80-\xBF]{2}'; - $ptr4Octet = '[\xF0-\xF4][\x80-\xBF]{3}'; - $ptr5Octet = '[\xF8-\xFB][\x80-\xBF]{4}'; - $ptr6Octet = '[\xFC-\xFD][\x80-\xBF]{5}'; - return preg_match("/^($ptrASCII|$ptr2Octet|$ptr3Octet|$ptr4Octet|$ptr5Octet|$ptr6Octet)*$/s", $s); -} - -/** * Check for UTF-8 URLs; Internet Explorer produces these if you * type non-ASCII chars in the URL bar or follow unescaped links. * Requires urldecoded pagename. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-15 14:48:37
|
Revision: 9266 http://sourceforge.net/p/phpwiki/code/9266 Author: vargenau Date: 2014-10-15 14:48:34 +0000 (Wed, 15 Oct 2014) Log Message: ----------- Use __construct; avoid trigger_error Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-15 13:14:10 UTC (rev 9265) +++ trunk/lib/stdlib.php 2014-10-15 14:48:34 UTC (rev 9266) @@ -668,7 +668,7 @@ class Stack { - function Stack() + function __construct() { $this->items = array(); $this->size = 0; @@ -1349,6 +1349,35 @@ class fileSet { + function __construct($directory, $filepattern = false) + { + $this->_fileList = array(); + $this->_pattern = $filepattern; + if ($filepattern) { + $this->_pcre_pattern = glob_to_pcre($this->_pattern); + } + $this->_case = !isWindows(); + $this->_pathsep = '/'; + + if (empty($directory)) { + return; // early return + } + + @$dir_handle = opendir($dir = $directory); + if (empty($dir_handle)) { + return; // early return + } + + while ($filename = readdir($dir_handle)) { + if ($filename[0] == '.' || filetype($dir . $this->_pathsep . $filename) != 'file') + continue; + if ($this->_filenameSelector($filename)) { + array_push($this->_fileList, "$filename"); + } + } + closedir($dir_handle); + } + /** * Build an array in $this->_fileList of files from $dirname. * Subdirectories are not traversed. @@ -1393,41 +1422,6 @@ $filename); } } - - function fileSet($directory, $filepattern = false) - { - $this->_fileList = array(); - $this->_pattern = $filepattern; - if ($filepattern) { - $this->_pcre_pattern = glob_to_pcre($this->_pattern); - } - $this->_case = !isWindows(); - $this->_pathsep = '/'; - - if (empty($directory)) { - trigger_error(sprintf(_("%s is empty."), 'directoryname'), - E_USER_NOTICE); - return; // early return - } - - @ $dir_handle = opendir($dir = $directory); - if (empty($dir_handle)) { - trigger_error(sprintf(_("Unable to open directory “%s” for reading"), - $dir), E_USER_NOTICE); - return; // early return - } - - while ($filename = readdir($dir_handle)) { - if ($filename[0] == '.' || filetype($dir . $this->_pathsep . $filename) != 'file') - continue; - if ($this->_filenameSelector($filename)) { - array_push($this->_fileList, "$filename"); - //trigger_error(sprintf(_("found file %s"), $filename), - // E_USER_NOTICE); //debugging - } - } - closedir($dir_handle); - } } // File globbing @@ -1436,7 +1430,8 @@ class ListRegexExpand { public $match, $list, $index, $case_sensitive; - function ListRegexExpand(&$list, $match, $case_sensitive = true) + + function __construct(&$list, $match, $case_sensitive = true) { $this->match = $match; $this->list = &$list; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-15 16:14:51
|
Revision: 9268 http://sourceforge.net/p/phpwiki/code/9268 Author: vargenau Date: 2014-10-15 16:14:43 +0000 (Wed, 15 Oct 2014) Log Message: ----------- Revert __construct; remove unused class ListRegexExpand Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-15 16:14:03 UTC (rev 9267) +++ trunk/lib/stdlib.php 2014-10-15 16:14:43 UTC (rev 9268) @@ -56,8 +56,6 @@ sort_file_mtime ($a, $b) class fileSet {fileSet($directory, $filepattern = false), getFiles($exclude='', $sortby='', $limit='') } - class ListRegexExpand { listMatchCallback($item, $key), - expandRegex ($index, &$pages) } glob_to_pcre ($glob) glob_match ($glob, $against, $case_sensitive = true) @@ -668,7 +666,7 @@ class Stack { - function __construct() + function Stack() { $this->items = array(); $this->size = 0; @@ -1349,7 +1347,7 @@ class fileSet { - function __construct($directory, $filepattern = false) + function fileSet($directory, $filepattern = false) { $this->_fileList = array(); $this->_pattern = $filepattern; @@ -1359,11 +1357,11 @@ $this->_case = !isWindows(); $this->_pathsep = '/'; - if (empty($directory)) { + if (empty($directory) or !file_exists($directory) or !is_dir($directory)) { return; // early return } - @$dir_handle = opendir($dir = $directory); + $dir_handle = opendir($dir = $directory); if (empty($dir_handle)) { return; // early return } @@ -1424,40 +1422,6 @@ } } -// File globbing - -// expands a list containing regex's to its matching entries -class ListRegexExpand -{ - public $match, $list, $index, $case_sensitive; - - function __construct(&$list, $match, $case_sensitive = true) - { - $this->match = $match; - $this->list = &$list; - $this->case_sensitive = $case_sensitive; - //$this->index = false; - } - - function listMatchCallback($item, $key) - { - $quoted = str_replace('/', '\/', $item); - if (preg_match('/' . $this->match . ($this->case_sensitive ? '/' : '/i'), - $quoted) - ) { - unset($this->list[$this->index]); - $this->list[] = $item; - } - } - - function expandRegex($index, &$pages) - { - $this->index = $index; - array_walk($pages, array($this, 'listMatchCallback')); - return $this->list; - } -} - // Convert fileglob to regex style: // Convert some wildcards to pcre style, escape the rest // Escape . \\ + * ? [ ^ ] $ ( ) { } = ! < > | : / This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-16 09:43:00
|
Revision: 9271 http://sourceforge.net/p/phpwiki/code/9271 Author: vargenau Date: 2014-10-16 09:42:51 +0000 (Thu, 16 Oct 2014) Log Message: ----------- Remove unused function DataURL Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-15 17:11:30 UTC (rev 9270) +++ trunk/lib/stdlib.php 2014-10-16 09:42:51 UTC (rev 9271) @@ -251,16 +251,6 @@ return SERVER_URL . $url; } -function DataURL($url) -{ - if (preg_match('/^https?:/', $url)) - return $url; - $url = NormalizeWebFileName($url); - if (DEBUG and $GLOBALS['request']->getArg('start_debug') and substr($url, -4, 4) == '.php') - $url .= "?start_debug=1"; // XMLRPC and SOAP debugging helper. - return AbsoluteURL($url); -} - /** * Generates icon in front of links. * @@ -804,6 +794,9 @@ */ public $anchor; + public $_errors; + public $_warnings; + /** * @param mixed $name Page name. * WikiDB_Page, WikiDB_PageRevision, or string. @@ -833,8 +826,6 @@ if (strstr($url, '//')) { if ($moniker == 'Talk') $name = $name . SUBPAGE_SEPARATOR . _("Discussion"); - elseif ($moniker == 'User') - $name = $name; } else { $name = $url; } @@ -1768,6 +1759,7 @@ //$content = join("\n", $content); //$return_array = true; $wordcount = 0; + $new = array(); foreach ($content as $line) { $words = explode(' ', $line); if ($wordcount + count($words) > $n) { @@ -1919,7 +1911,7 @@ } /** - * @param var $needle + * @param mixed $needle * @param array $haystack one-dimensional numeric array only, no hash * @return integer * @desc Feed a sorted array to $haystack and a value to search for to $needle. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-16 10:18:43
|
Revision: 9273 http://sourceforge.net/p/phpwiki/code/9273 Author: vargenau Date: 2014-10-16 10:18:36 +0000 (Thu, 16 Oct 2014) Log Message: ----------- Add class imageOrVideoSet Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-16 09:56:27 UTC (rev 9272) +++ trunk/lib/stdlib.php 2014-10-16 10:18:36 UTC (rev 9273) @@ -57,6 +57,7 @@ class fileSet {fileSet($directory, $filepattern = false), getFiles($exclude='', $sortby='', $limit='') } class imageSet extends fileSet + class imageOrVideoSet extends fileSet glob_to_pcre ($glob) glob_match ($glob, $against, $case_sensitive = true) @@ -1422,10 +1423,18 @@ */ function _filenameSelector($filename) { - return preg_match("/(" . INLINE_IMAGES . ")$/i", $filename); + return is_image($filename); } } +class imageOrVideoSet extends fileSet +{ + function _filenameSelector($filename) + { + return is_image($filename) or is_video($filename); + } +} + // Convert fileglob to regex style: // Convert some wildcards to pcre style, escape the rest // Escape . \\ + * ? [ ^ ] $ ( ) { } = ! < > | : / This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-25 16:12:11
|
Revision: 9374 http://sourceforge.net/p/phpwiki/code/9374 Author: vargenau Date: 2014-11-25 16:12:04 +0000 (Tue, 25 Nov 2014) Log Message: ----------- Simplify function obj2hash Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-11-25 16:03:47 UTC (rev 9373) +++ trunk/lib/stdlib.php 2014-11-25 16:12:04 UTC (rev 9374) @@ -71,7 +71,7 @@ phpwiki_version () isWikiWord ($word) - obj2hash ($obj, $exclude = false, $fields = false) + obj2hash($obj, $exclude = array()) url_get_contents ($uri) GenerateId ($name) firstNWordsOfContent ($n, $content) @@ -1699,13 +1699,13 @@ } // needed to store serialized objects-values only (perm, pref) -function obj2hash($obj, $exclude = false, $fields = false) +function obj2hash($obj, $exclude = array()) { $a = array(); - if (!$fields) $fields = get_object_vars($obj); + $fields = get_object_vars($obj); foreach ($fields as $key => $val) { - if (is_array($exclude)) { - if (in_array($key, $exclude)) continue; + if (in_array($key, $exclude)) { + continue; } $a[$key] = $val; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-03-30 10:43:36
|
Revision: 9632 http://sourceforge.net/p/phpwiki/code/9632 Author: vargenau Date: 2015-03-30 10:43:29 +0000 (Mon, 30 Mar 2015) Log Message: ----------- Remove xa0 (non breaking space), it prevented to create create pages containing "?\195?\160" in UTF-8 Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2015-03-25 13:56:37 UTC (rev 9631) +++ trunk/lib/stdlib.php 2015-03-30 10:43:29 UTC (rev 9632) @@ -923,7 +923,7 @@ private function _check($pagename) { // Compress internal white-space to single space character. - $pagename = preg_replace('/[\s\xa0]+/', ' ', $orig = $pagename); + $pagename = preg_replace('/[\s]+/', ' ', $orig = $pagename); if ($pagename != $orig) $this->_warnings[] = _("White space converted to single space"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-03-17 08:32:00
|
Revision: 9811 http://sourceforge.net/p/phpwiki/code/9811 Author: vargenau Date: 2016-03-17 08:31:57 +0000 (Thu, 17 Mar 2016) Log Message: ----------- Fusionforge already defines is_utf8 Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2016-03-17 08:16:19 UTC (rev 9810) +++ trunk/lib/stdlib.php 2016-03-17 08:31:57 UTC (rev 9811) @@ -2163,6 +2163,9 @@ echo "</body></html>\n"; } +// Fusionforge already defines is_utf8 +if (!(defined('FUSIONFORGE') && FUSIONFORGE)) { + /** * is_utf8 - utf-8 detection * @@ -2196,3 +2199,5 @@ } return true; } + +} // END FUSIONFORGE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-05-25 08:49:22
|
Revision: 9846 http://sourceforge.net/p/phpwiki/code/9846 Author: vargenau Date: 2016-05-25 08:49:19 +0000 (Wed, 25 May 2016) Log Message: ----------- PageList: be case consistent Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2016-05-25 08:47:34 UTC (rev 9845) +++ trunk/lib/stdlib.php 2016-05-25 08:49:19 UTC (rev 9846) @@ -1377,7 +1377,7 @@ if ($sortby) { require_once 'lib/PageList.php'; - switch (Pagelist::sortby($sortby, 'db')) { + switch (PageList::sortby($sortby, 'db')) { case 'pagename ASC': break; case 'pagename DESC': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-12-05 18:05:12
|
Revision: 9989 http://sourceforge.net/p/phpwiki/code/9989 Author: vargenau Date: 2016-12-05 18:05:10 +0000 (Mon, 05 Dec 2016) Log Message: ----------- Add missing </div> Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2016-12-05 18:00:38 UTC (rev 9988) +++ trunk/lib/stdlib.php 2016-12-05 18:05:10 UTC (rev 9989) @@ -2137,6 +2137,7 @@ echo "</div>\n"; echo "</main>\n"; echo "</div>\n"; + echo "</div>\n"; } elseif (is_a($WikiTheme, 'WikiTheme_Sidebar') or is_a($WikiTheme, 'WikiTheme_MonoBook') ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2017-05-18 18:36:35
|
Revision: 10005 http://sourceforge.net/p/phpwiki/code/10005 Author: vargenau Date: 2017-05-18 18:36:34 +0000 (Thu, 18 May 2017) Log Message: ----------- PHP Doc Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2017-03-13 16:10:12 UTC (rev 10004) +++ trunk/lib/stdlib.php 2017-05-18 18:36:34 UTC (rev 10005) @@ -351,7 +351,7 @@ * Check against their urlencoded values also. * * @param string $url URL to check for unsafe characters. - * @return boolean True if same, false else. + * @return bool True if safe, false else. */ function IsSafeURL($url) { @@ -1188,8 +1188,8 @@ * Short format is used for PageList * Long format is used in PageInfo * - * @param $bytes int. Default: 0. - * @param $longformat bool. Default: false. + * @param int $bytes Default: 0. + * @param bool $longformat Default: false. * @return FormattedText (XmlElement.php). */ function ByteFormatter($bytes = 0, $longformat = false) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2017-05-30 09:00:04
|
Revision: 10014 http://sourceforge.net/p/phpwiki/code/10014 Author: vargenau Date: 2017-05-30 09:00:02 +0000 (Tue, 30 May 2017) Log Message: ----------- URL for image can be /path/to/image.png Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2017-05-25 08:15:06 UTC (rev 10013) +++ trunk/lib/stdlib.php 2017-05-30 09:00:02 UTC (rev 10014) @@ -416,7 +416,7 @@ // Extract URL $arr = explode(' ', $url); if (!empty($arr)) $url = $arr[0]; - if (!IsSafeURL($url)) { + if (!IsSafeURL($url, false)) { $link = HTML::span(array('class' => 'error'), _('Bad URL for image')); return $link; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2017-05-30 12:33:36
|
Revision: 10015 http://sourceforge.net/p/phpwiki/code/10015 Author: vargenau Date: 2017-05-30 12:33:34 +0000 (Tue, 30 May 2017) Log Message: ----------- URL for image can be /path/to/image.png Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2017-05-30 09:00:02 UTC (rev 10014) +++ trunk/lib/stdlib.php 2017-05-30 12:33:34 UTC (rev 10015) @@ -357,10 +357,13 @@ */ function IsSafeURL($url, $http_only = true) { - if (preg_match('/([<>"])|(%3C)|(%3E)|(%22)/', $url) || (filter_var($url, FILTER_VALIDATE_URL) === false)) { + if (preg_match('/([<>"])|(%3C)|(%3E)|(%22)/', $url)) { return false; } if ($http_only) { + if (filter_var($url, FILTER_VALIDATE_URL) === false) { + return false; + } $scheme = parse_url($url, PHP_URL_SCHEME); return ($scheme == 'http') || ($scheme == 'https'); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2017-05-30 15:41:37
|
Revision: 10018 http://sourceforge.net/p/phpwiki/code/10018 Author: vargenau Date: 2017-05-30 15:41:35 +0000 (Tue, 30 May 2017) Log Message: ----------- Fix PHP syntax Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2017-05-30 14:55:08 UTC (rev 10017) +++ trunk/lib/stdlib.php 2017-05-30 15:41:35 UTC (rev 10018) @@ -382,7 +382,7 @@ { // FIXME: Is this needed (or sufficient?) if (!IsSafeURL($url)) { - $link = HTML::span(array('class' => 'error'), _('Bad URL').' -- '._('Remove all of <, >, "'); + $link = HTML::span(array('class' => 'error'), _('Bad URL').' -- '._('Remove all of <, >, "')); return $link; } else { if (!$linktext) @@ -420,7 +420,7 @@ $arr = explode(' ', $url); if (!empty($arr)) $url = $arr[0]; if (!IsSafeURL($url)) { - $link = HTML::span(array('class' => 'error'), _('Bad URL for image').' -- '._('Remove all of <, >, "'); + $link = HTML::span(array('class' => 'error'), _('Bad URL for image').' -- '._('Remove all of <, >, "')); return $link; } // spaces in inline images must be %20 encoded! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-03 06:52:16
|
Revision: 10529 http://sourceforge.net/p/phpwiki/code/10529 Author: vargenau Date: 2021-09-03 06:52:13 +0000 (Fri, 03 Sep 2021) Log Message: ----------- Remove "Bad pagename" warning Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2021-09-01 16:32:44 UTC (rev 10528) +++ trunk/lib/stdlib.php 2021-09-03 06:52:13 UTC (rev 10529) @@ -913,8 +913,6 @@ private function _normalize_bad_pagename($name) { - trigger_error("Bad pagename: " . $name, E_USER_WARNING); - // Punt... You really shouldn't get here. if (empty($name)) { global $request; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-20 10:00:39
|
Revision: 10910 http://sourceforge.net/p/phpwiki/code/10910 Author: vargenau Date: 2022-01-20 10:00:37 +0000 (Thu, 20 Jan 2022) Log Message: ----------- Better handle images with space in the filename Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2022-01-19 14:40:36 UTC (rev 10909) +++ trunk/lib/stdlib.php 2022-01-20 10:00:37 UTC (rev 10910) @@ -415,8 +415,17 @@ $alt = ""; } // Extract URL - $arr = explode(' ', $url); - if (!empty($arr)) $url = $arr[0]; + // Space might be part of the filename, or separate the filename and the attributes + // [[Upload:raton laveur.jpg]] here the $url ends with an image extension, so space is part of the filename + // [[Upload:sanglier.jpg size=20% align=right]] here the space separates the filename and the attributes + // [[Upload:raton laveur.jpg size=20% align=right]] will fail + // It should be encoded as [[Upload:admin/raton%20laveur.jpg size=20% align=right]] + if (!is_image($url)) { + $arr = explode(' ', $url); + if (!empty($arr)) { + $url = $arr[0]; + } + } if (!IsSafeURL($url)) { return HTML::span(array('class' => 'error'), _('Bad URL for image').' -- '._('Remove all of <, >, "')); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |