From: <var...@us...> - 2010-05-18 14:34:00
|
Revision: 7403 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7403&view=rev Author: vargenau Date: 2010-05-18 14:33:53 +0000 (Tue, 18 May 2010) Log Message: ----------- Lets's have a single global isActionPage() function Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-05-18 13:23:25 UTC (rev 7402) +++ trunk/lib/stdlib.php 2010-05-18 14:33:53 UTC (rev 7403) @@ -73,6 +73,7 @@ count_all ($arg) isSubPage ($pagename) subPageSlice ($pagename, $pos) + isActionPage ($filename) phpwiki_version () isWikiWord ($word) @@ -84,7 +85,7 @@ firstNWordsOfContent ($n, $content) extractSection ($section, $content, $page, $quiet = false, $sectionhead = false) isExternalReferrer() - + charset_convert($from, $to, $data) string_starts_with($string, $prefix) string_ends_with($string, $suffix) @@ -177,7 +178,7 @@ function WikiURL($pagename, $args = '', $get_abs_url = false) { global $request, $WikiTheme; $anchor = false; - + if (is_object($pagename)) { if (isa($pagename, 'WikiDB_Page')) { $pagename = $pagename->getName(); @@ -1899,6 +1900,13 @@ return $pages[0]; } +function isActionPage($filename) { + + global $AllActionPages; + + return (in_array($filename, $AllActionPages)); +} + /** * Alert * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-11 16:10:03
|
Revision: 7527 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7527&view=rev Author: vargenau Date: 2010-06-11 16:09:57 +0000 (Fri, 11 Jun 2010) Log Message: ----------- Patch by S?\195?\169bastien Le Callonnec: phpwiki-Bugs-3002942 Initial Wiki Population aborts due to error Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-06-11 15:55:07 UTC (rev 7526) +++ trunk/lib/stdlib.php 2010-06-11 16:09:57 UTC (rev 7527) @@ -545,6 +545,7 @@ $size = @getimagesize($path); $link->setAttr('src', getUploadDataPath() . rawurldecode($file)); } else { // elsewhere + global $request; $size = @getimagesize($request->get('DOCUMENT_ROOT').urldecode($url)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-17 13:50:38
|
Revision: 7545 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7545&view=rev Author: vargenau Date: 2010-06-17 13:50:31 +0000 (Thu, 17 Jun 2010) Log Message: ----------- Remove obsolete comments Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-06-17 13:35:18 UTC (rev 7544) +++ trunk/lib/stdlib.php 2010-06-17 13:50:31 UTC (rev 7545) @@ -102,14 +102,8 @@ is_video ($filename) compute_tablecell ($table, $i, $j, $imax, $jmax) - function: LinkInterWikiLink($link, $linktext) - moved to: lib/interwiki.php function: linkExistingWikiWord($wikiword, $linktext, $version) moved to: lib/WikiTheme.php - function: LinkUnknownWikiWord($wikiword, $linktext) - moved to: lib/WikiTheme.php - function: UpdateRecentChanges($dbi, $pagename, $isnewpage) - gone see: lib/plugin/RecentChanges.php */ if (defined('_PHPWIKI_STDLIB_LOADED')) return; else define('_PHPWIKI_STDLIB_LOADED', true); @@ -521,10 +515,6 @@ $size = 0; // Prepare for getimagesize($url) // $url only valid for external urls, otherwise local path - // Older php versions crash here with certain png's: - // confirmed for 4.1.2, 4.1.3, 4.2.3; 4.3.2 and 4.3.7 are ok - // http://phpwiki.sourceforge.net/demo/themes/default/images/http.png - // See http://bugs.php.net/search.php?cmd=display&search_for=getimagesize if (DISABLE_GETIMAGESIZE) ; elseif (! preg_match("/\.$force_img$/i", $url)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-23 15:42:37
|
Revision: 7564 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7564&view=rev Author: vargenau Date: 2010-06-23 15:42:31 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Remove unused function can Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-06-23 15:37:35 UTC (rev 7563) +++ trunk/lib/stdlib.php 2010-06-23 15:42:31 UTC (rev 7564) @@ -1746,16 +1746,6 @@ || is_subclass_of($object, $lclass) ); } -/** Determine whether (possible) object has method. - * - * @param $object mixed Object - * @param $method string Method name - * @return bool True iff $object is an object with has method $method. - */ -function can ($object, $method) { - return is_object($object) && method_exists($object, strtolower($method)); -} - /** Determine whether a function is okay to use. * * Some providers (e.g. Lycos) disable some of PHP functions for This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-26 14:54:20
|
Revision: 7576 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7576&view=rev Author: vargenau Date: 2010-06-26 14:54:14 +0000 (Sat, 26 Jun 2010) Log Message: ----------- No border Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-06-26 14:53:21 UTC (rev 7575) +++ trunk/lib/stdlib.php 2010-06-26 14:54:14 UTC (rev 7576) @@ -298,7 +298,7 @@ list ($proto) = explode(':', $protocol_or_url, 2); $src = $WikiTheme->getLinkIconURL($proto); if ($src) - return HTML::img(array('src' => $src, 'alt' => "", 'class' => 'linkicon', 'border' => 0)); + return HTML::img(array('src' => $src, 'alt' => "", 'class' => 'linkicon')); else return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-10-20 16:19:46
|
Revision: 7716 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7716&view=rev Author: vargenau Date: 2010-10-20 16:19:40 +0000 (Wed, 20 Oct 2010) Log Message: ----------- Check file exists Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2010-10-14 15:49:22 UTC (rev 7715) +++ trunk/lib/stdlib.php 2010-10-20 16:19:40 UTC (rev 7716) @@ -649,9 +649,9 @@ } $type = $img->getAttr('type'); if (!$type) { - // TODO: map extension to mime-types if type is not given and php < 4.3 - if (function_exists('mime_content_type')) + if (function_exists('mime_content_type') && file_exists($url)) { $type = mime_content_type($url); + } } $object = HTML::object(array_merge($img->_attr, array('type' => $type)), //'src' => $url This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-01-31 15:58:19
|
Revision: 7920 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7920&view=rev Author: vargenau Date: 2011-01-31 15:58:13 +0000 (Mon, 31 Jan 2011) Log Message: ----------- Localize action pages Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-01-27 17:02:14 UTC (rev 7919) +++ trunk/lib/stdlib.php 2011-01-31 15:58:13 UTC (rev 7920) @@ -1880,7 +1880,9 @@ global $AllActionPages; - return (in_array($filename, $AllActionPages)); + $localizedAllActionPages = array_map("gettext", $AllActionPages); + + return (in_array($filename, $localizedAllActionPages)); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-03-04 16:43:49
|
Revision: 7963 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7963&view=rev Author: vargenau Date: 2011-03-04 16:43:43 +0000 (Fri, 04 Mar 2011) Log Message: ----------- Remove unused function Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-03-04 16:30:15 UTC (rev 7962) +++ trunk/lib/stdlib.php 2011-03-04 16:43:43 UTC (rev 7963) @@ -150,16 +150,6 @@ } /** - * 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 - * configuration file. - * @return string The name of the WIKI_ID cookie to use for this wiki. - */ -function GetCookieName() { - return preg_replace("/[^\d\w]/", "_", WIKI_NAME) . "_WIKI_ID"; -} - -/** * Generates a valid URL for a given Wiki pagename. * @param mixed $pagename If a string this will be the name of the Wiki page to link to. * If a WikiDB_Page object function will extract the name to link to. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-03-07 15:23:59
|
Revision: 7969 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7969&view=rev Author: vargenau Date: 2011-03-07 15:23:53 +0000 (Mon, 07 Mar 2011) Log Message: ----------- Revert removing getCookieName ("grep -i" is better) Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-03-07 13:39:47 UTC (rev 7968) +++ trunk/lib/stdlib.php 2011-03-07 15:23:53 UTC (rev 7969) @@ -150,6 +150,16 @@ } /** +* 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 +* configuration file. +* @return string The name of the WIKI_ID cookie to use for this wiki. +*/ +function getCookieName() { + return preg_replace("/[^\d\w]/", "_", WIKI_NAME) . "_WIKI_ID"; +} + +/** * Generates a valid URL for a given Wiki pagename. * @param mixed $pagename If a string this will be the name of the Wiki page to link to. * If a WikiDB_Page object function will extract the name to link to. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2011-04-04 09:29:48
|
Revision: 8009 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8009&view=rev Author: rurban Date: 2011-04-04 09:29:37 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Fix spaces in imagepaths (again): do not split, rather shorten url from the back by detected attr Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-03-31 09:44:56 UTC (rev 8008) +++ trunk/lib/stdlib.php 2011-04-04 09:29:37 UTC (rev 8009) @@ -100,6 +100,7 @@ parse_attributes($line) is_image ($filename) is_video ($filename) + compute_tablecell ($table, $i, $j, $imax, $jmax) function: linkExistingWikiWord($wikiword, $linktext, $version) moved to: lib/WikiTheme.php @@ -158,7 +159,7 @@ function getCookieName() { return preg_replace("/[^\d\w]/", "_", WIKI_NAME) . "_WIKI_ID"; } - + /** * Generates a valid URL for a given Wiki pagename. * @param mixed $pagename If a string this will be the name of the Wiki page to link to. @@ -204,7 +205,7 @@ if (USE_PATH_INFO and $key == 'pagename') ; elseif ($key == 'action' and $val == 'browse') - ; + ; elseif (!is_array($val)) // ugly hack for getURLtoSelf() which also takes POST vars $enc_args[] = urlencode($key) . '=' . urlencode($val); } @@ -213,24 +214,24 @@ if (USE_PATH_INFO or !empty($WikiTheme->HTML_DUMP_SUFFIX)) { $url = $get_abs_url ? (SERVER_URL . VIRTUAL_PATH . "/") : ""; - $base = preg_replace('/%2f/i', '/', rawurlencode($pagename)); - $url .= $base; + $base = preg_replace('/%2f/i', '/', rawurlencode($pagename)); + $url .= $base; if (!empty($WikiTheme->HTML_DUMP_SUFFIX)) { - if (!empty($WikiTheme->VALID_LINKS) and $request->getArg('action') == 'pdf') { - if (!in_array($pagename, $WikiTheme->VALID_LINKS)) - $url = ''; - else - $url = $base . $WikiTheme->HTML_DUMP_SUFFIX; + if (!empty($WikiTheme->VALID_LINKS) and $request->getArg('action') == 'pdf') { + if (!in_array($pagename, $WikiTheme->VALID_LINKS)) + $url = ''; + else + $url = $base . $WikiTheme->HTML_DUMP_SUFFIX; + } else { + $url .= $WikiTheme->HTML_DUMP_SUFFIX; + if ($args) + $url .= "?$args"; + } } else { - $url .= $WikiTheme->HTML_DUMP_SUFFIX; - if ($args) - $url .= "?$args"; - } - } else { - if ($args) - $url .= "?$args"; + if ($args) + $url .= "?$args"; + } } - } else { $url = $get_abs_url ? SERVER_URL . SCRIPT_NAME : basename(SCRIPT_NAME); $url .= "?pagename=" . rawurlencode($pagename); @@ -418,9 +419,6 @@ // support new syntax: [prefix/image.jpg size=50% border=n] if (empty($alt)) $alt = ""; - // Extract URL - $arr = explode(' ',$url); - if (!empty($arr)) $url = $arr[0]; if (! IsSafeURL($url)) { $link = HTML::span(array('class' => 'error'), _("BAD URL -- remove all of <, >, \"")); return $link; @@ -428,9 +426,13 @@ // spaces in inline images must be %20 encoded! $link = HTML::img(array('src' => $url)); - // Extract attributes - $arr = parse_attributes(strstr($ori_url, " ")); + // Extract attributes and shorten url + $arr = parse_attributes(strstr($url, " ")); foreach ($arr as $attr => $value) { + // strip attr=... url suffix + $i = strpos($url, $attr); + $url = substr($url, 0, $i-1); + $link->setAttr('src', $url); // These attributes take strings: lang, id, title, alt if (($attr == "lang") || ($attr == "id") @@ -476,9 +478,9 @@ } } // Correct silently the most common error - if ($url != $ori_url and empty($arr) and !preg_match("/^http/",$url)) { - // space belongs to the path - $file = NormalizeLocalFileName($ori_url); + if (strstr($ori_url, " ") and !preg_match("/^http/",$url)) { + // space belongs to the path + $file = NormalizeLocalFileName($ori_url); if (file_exists($file)) { $link = HTML::img(array('src' => $ori_url)); trigger_error( @@ -576,6 +578,7 @@ * http://www.alleged.org.uk/pdc/2002/svg-object.html * * Allowed object tags: + * ID * DATA=URI (object data) * CLASSID=URI (location of implementation) * ARCHIVE=CDATA (archive files) @@ -593,7 +596,7 @@ */ function ImgObject($img, $url) { // get the url args: data="sample.svgz" type="image/svg+xml" width="400" height="300" - $params = explode(",","data,classid,archive,codebase,name,usemap,type,". + $params = explode(",","id,width,height,data,classid,archive,codebase,name,usemap,type,". "codetype,standby,tabindex,declare"); if (is_array($url)) { $args = $url; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-04-04 12:58:30
|
Revision: 8010 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8010&view=rev Author: vargenau Date: 2011-04-04 12:58:24 +0000 (Mon, 04 Apr 2011) Log Message: ----------- compute_tablecell was moved to plugin Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-04-04 09:29:37 UTC (rev 8009) +++ trunk/lib/stdlib.php 2011-04-04 12:58:24 UTC (rev 8010) @@ -100,7 +100,6 @@ parse_attributes($line) is_image ($filename) is_video ($filename) - compute_tablecell ($table, $i, $j, $imax, $jmax) function: linkExistingWikiWord($wikiword, $linktext, $version) moved to: lib/WikiTheme.php @@ -205,7 +204,7 @@ if (USE_PATH_INFO and $key == 'pagename') ; elseif ($key == 'action' and $val == 'browse') - ; + ; elseif (!is_array($val)) // ugly hack for getURLtoSelf() which also takes POST vars $enc_args[] = urlencode($key) . '=' . urlencode($val); } @@ -214,24 +213,24 @@ if (USE_PATH_INFO or !empty($WikiTheme->HTML_DUMP_SUFFIX)) { $url = $get_abs_url ? (SERVER_URL . VIRTUAL_PATH . "/") : ""; - $base = preg_replace('/%2f/i', '/', rawurlencode($pagename)); - $url .= $base; + $base = preg_replace('/%2f/i', '/', rawurlencode($pagename)); + $url .= $base; if (!empty($WikiTheme->HTML_DUMP_SUFFIX)) { - if (!empty($WikiTheme->VALID_LINKS) and $request->getArg('action') == 'pdf') { - if (!in_array($pagename, $WikiTheme->VALID_LINKS)) - $url = ''; - else - $url = $base . $WikiTheme->HTML_DUMP_SUFFIX; - } else { - $url .= $WikiTheme->HTML_DUMP_SUFFIX; - if ($args) - $url .= "?$args"; - } + if (!empty($WikiTheme->VALID_LINKS) and $request->getArg('action') == 'pdf') { + if (!in_array($pagename, $WikiTheme->VALID_LINKS)) + $url = ''; + else + $url = $base . $WikiTheme->HTML_DUMP_SUFFIX; } else { - if ($args) - $url .= "?$args"; - } + $url .= $WikiTheme->HTML_DUMP_SUFFIX; + if ($args) + $url .= "?$args"; + } + } else { + if ($args) + $url .= "?$args"; } + } else { $url = $get_abs_url ? SERVER_URL . SCRIPT_NAME : basename(SCRIPT_NAME); $url .= "?pagename=" . rawurlencode($pagename); @@ -429,10 +428,10 @@ // Extract attributes and shorten url $arr = parse_attributes(strstr($url, " ")); foreach ($arr as $attr => $value) { - // strip attr=... url suffix - $i = strpos($url, $attr); - $url = substr($url, 0, $i-1); - $link->setAttr('src', $url); + // strip attr=... url suffix + $i = strpos($url, $attr); + $url = substr($url, 0, $i-1); + $link->setAttr('src', $url); // These attributes take strings: lang, id, title, alt if (($attr == "lang") || ($attr == "id") @@ -479,8 +478,8 @@ } // Correct silently the most common error if (strstr($ori_url, " ") and !preg_match("/^http/",$url)) { - // space belongs to the path - $file = NormalizeLocalFileName($ori_url); + // space belongs to the path + $file = NormalizeLocalFileName($ori_url); if (file_exists($file)) { $link = HTML::img(array('src' => $ori_url)); trigger_error( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-05-04 10:20:52
|
Revision: 8061 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8061&view=rev Author: vargenau Date: 2011-05-04 10:20:46 +0000 (Wed, 04 May 2011) Log Message: ----------- New utility function: is_whole_number Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-04-27 13:53:27 UTC (rev 8060) +++ trunk/lib/stdlib.php 2011-05-04 10:20:46 UTC (rev 8061) @@ -97,6 +97,7 @@ is_localhost($url) javascript_quote_string($s) isSerialized($s) + is_whole_number($var) parse_attributes($line) is_image ($filename) is_video ($filename) @@ -2383,6 +2384,14 @@ } /** + * Determine if a variable represents a whole number + */ + +function is_whole_number($var) { + return (is_numeric($var) && (intval($var)==floatval($var))); +} + +/** * Take a string and return an array of pairs (attribute name, attribute value) * * We allow attributes with or without double quotes (") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-06-08 07:46:39
|
Revision: 8095 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8095&view=rev Author: vargenau Date: 2011-06-08 07:46:33 +0000 (Wed, 08 Jun 2011) Log Message: ----------- allow "center" as synonym for "middle"; better error message Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-06-07 14:27:18 UTC (rev 8094) +++ trunk/lib/stdlib.php 2011-06-08 07:46:33 UTC (rev 8095) @@ -159,7 +159,7 @@ function getCookieName() { return preg_replace("/[^\d\w]/", "_", WIKI_NAME) . "_WIKI_ID"; } - + /** * Generates a valid URL for a given Wiki pagename. * @param mixed $pagename If a string this will be the name of the Wiki page to link to. @@ -441,12 +441,17 @@ $link->setAttr($attr, $value); } // align = bottom|middle|top|left|right + // we allow "center" as synonym for "middle" elseif (($attr == "align") && (($value == "bottom") || ($value == "middle") + || ($value == "center") || ($value == "top") || ($value == "left") || ($value == "right"))) { + if ($value == "center") { + $value = "middle"; + } $link->setAttr($attr, $value); } // These attributes take a number (pixels): border, hspace, vspace @@ -471,9 +476,10 @@ } } else { + $url = substr(strrchr($url, "/"), 1); $link = HTML::span(array('class' => 'error'), - sprintf(_("Invalid image attribute \"%s\" %s=%s"), - $url, $attr, $value)); + sprintf(_("Invalid attribute %s=%s for image %s"), + $attr, $value, $url)); return $link; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-06-08 13:21:51
|
Revision: 8096 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8096&view=rev Author: vargenau Date: 2011-06-08 13:21:45 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Do not trim last character from image name when there are attributes (bug from r8009) Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-06-08 07:46:33 UTC (rev 8095) +++ trunk/lib/stdlib.php 2011-06-08 13:21:45 UTC (rev 8096) @@ -430,9 +430,9 @@ $arr = parse_attributes(strstr($url, " ")); foreach ($arr as $attr => $value) { // strip attr=... url suffix + $link->setAttr('src', $url); $i = strpos($url, $attr); $url = substr($url, 0, $i-1); - $link->setAttr('src', $url); // These attributes take strings: lang, id, title, alt if (($attr == "lang") || ($attr == "id") @@ -476,7 +476,7 @@ } } else { - $url = substr(strrchr($url, "/"), 1); + $url = substr(strrchr($ori_url, "/"), 1); $link = HTML::span(array('class' => 'error'), sprintf(_("Invalid attribute %s=%s for image %s"), $attr, $value, $url)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-06-09 07:54:44
|
Revision: 8097 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8097&view=rev Author: vargenau Date: 2011-06-09 07:54:38 +0000 (Thu, 09 Jun 2011) Log Message: ----------- Fix image test Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-06-08 13:21:45 UTC (rev 8096) +++ trunk/lib/stdlib.php 2011-06-09 07:54:38 UTC (rev 8097) @@ -563,7 +563,7 @@ * png|jpg|gif|jpeg|bmp|pl|cgi. If no image it is an object to embed. * Note: Allow cgi's (pl,cgi) returning images. */ - if (!preg_match("/\.(".$force_img.")/i", $url)) { + if (!preg_match("/\.(".$force_img.")/i", $ori_url)) { // HTML::img(array('src' => $url, 'alt' => $alt, 'title' => $alt)); // => HTML::object(array('src' => $url)) ...; return ImgObject($link, $ori_url); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-09-26 14:15:28
|
Revision: 8125 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8125&view=rev Author: vargenau Date: 2011-09-26 14:15:18 +0000 (Mon, 26 Sep 2011) Log Message: ----------- More explicit error message Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-09-26 14:10:17 UTC (rev 8124) +++ trunk/lib/stdlib.php 2011-09-26 14:15:18 UTC (rev 8125) @@ -386,7 +386,7 @@ function LinkURL($url, $linktext = '') { // 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 { @@ -420,7 +420,7 @@ if (empty($alt)) $alt = ""; if (! IsSafeURL($url)) { - $link = HTML::span(array('class' => 'error'), _("BAD URL -- 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...> - 2011-10-03 12:56:37
|
Revision: 8163 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8163&view=rev Author: vargenau Date: 2011-10-03 12:56:31 +0000 (Mon, 03 Oct 2011) Log Message: ----------- Okay --> OK Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-10-03 12:52:28 UTC (rev 8162) +++ trunk/lib/stdlib.php 2011-10-03 12:56:31 UTC (rev 8163) @@ -1950,7 +1950,7 @@ $buttons = $this->_buttons; if (!$buttons) - $buttons = array(_("Okay") => $request->getURLtoSelf()); + $buttons = array(_("OK") => $request->getURLtoSelf()); global $WikiTheme; foreach ($buttons as $label => $url) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-11-28 15:13:42
|
Revision: 8186 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8186&view=rev Author: vargenau Date: 2011-11-28 15:13:31 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Fix whitespace Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-11-28 14:23:07 UTC (rev 8185) +++ trunk/lib/stdlib.php 2011-11-28 15:13:31 UTC (rev 8186) @@ -159,7 +159,7 @@ function getCookieName() { return preg_replace("/[^\d\w]/", "_", WIKI_NAME) . "_WIKI_ID"; } - + /** * Generates a valid URL for a given Wiki pagename. * @param mixed $pagename If a string this will be the name of the Wiki page to link to. @@ -826,7 +826,7 @@ $this->shortName = $name; if (strstr($name, ':')) { list($moniker, $shortName) = explode (":", $name, 2); - $map = getInterwikiMap(); // allow overrides to custom maps + $map = getInterwikiMap(); // allow overrides to custom maps if (isset($map->_map[$moniker])) { $url = $map->_map[$moniker]; if (strstr($url, '%s')) @@ -845,17 +845,17 @@ } if (strstr($shortName, '?')) { list($shortName, $dummy) = explode("\?", $shortName, 2); - } + } $this->shortName = $shortName; } } - // FIXME: We should really fix the cause for "/PageName" in the WikiDB + // FIXME: We should really fix the cause for "/PageName" in the WikiDB if ($name == '' or $name[0] == SUBPAGE_SEPARATOR) { if ($basename) $name = $this->_pagename($basename) . $name; else { $name = $this->_normalize_bad_pagename($name); - $this->shortName = $name; + $this->shortName = $name; } } } @@ -899,20 +899,20 @@ } function _pagename($page) { - if (isa($page, 'WikiDB_Page')) - return $page->getName(); + if (isa($page, 'WikiDB_Page')) + return $page->getName(); elseif (isa($page, 'WikiDB_PageRevision')) - return $page->getPageName(); + return $page->getPageName(); elseif (isa($page, 'WikiPageName')) - return $page->name; + 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; + //assert(is_string($page)); + return $page; } function _normalize_bad_pagename($name) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-11-29 09:35:32
|
Revision: 8190 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8190&view=rev Author: vargenau Date: 2011-11-29 09:35:21 +0000 (Tue, 29 Nov 2011) Log Message: ----------- More explicit message Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-11-29 09:21:55 UTC (rev 8189) +++ trunk/lib/stdlib.php 2011-11-29 09:35:21 UTC (rev 8190) @@ -966,7 +966,7 @@ // not only for SQL, also to restrict url length if (strlen($pagename) > MAX_PAGENAME_LENGTH) { $pagename = substr($pagename, 0, MAX_PAGENAME_LENGTH); - $this->_errors[] = _("too long"); + $this->_errors[] = _("Page name too long"); } // disallow some chars only on file and cvs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-11-29 11:18:52
|
Revision: 8197 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8197&view=rev Author: vargenau Date: 2011-11-29 11:18:41 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Whitespace only Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-11-29 11:13:40 UTC (rev 8196) +++ trunk/lib/stdlib.php 2011-11-29 11:18:41 UTC (rev 8197) @@ -451,10 +451,10 @@ || ($value == "top") || ($value == "left") || ($value == "right"))) { - if ($value == "center") { - $value = "middle"; - } - $link->setAttr($attr, $value); + if ($value == "center") { + $value = "middle"; + } + $link->setAttr($attr, $value); } // These attributes take a number (pixels): border, hspace, vspace elseif ((($attr == "border") || ($attr == "hspace") || ($attr == "vspace")) @@ -476,8 +476,7 @@ $link->setAttr('width',$m[1]); $link->setAttr('height',$m[2]); } - } - else { + } else { $url = substr(strrchr($ori_url, "/"), 1); $link = HTML::span(array('class' => 'error'), sprintf(_("Invalid attribute %s=%s for image %s"), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-14 17:33:15
|
Revision: 8460 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8460&view=rev Author: vargenau Date: 2012-11-14 17:33:09 +0000 (Wed, 14 Nov 2012) Log Message: ----------- is_localhost has no parameter Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2012-11-14 17:31:23 UTC (rev 8459) +++ trunk/lib/stdlib.php 2012-11-14 17:33:09 UTC (rev 8460) @@ -94,7 +94,7 @@ printSimpleTrace($bt) getMemoryUsage() binary_search($needle, $haystack) - is_localhost($url) + is_localhost() javascript_quote_string($s) isSerialized($s) is_whole_number($var) @@ -2448,12 +2448,9 @@ } } -function is_localhost($url = false) +function is_localhost() { - if (!$url) { - global $HTTP_SERVER_VARS; - return $HTTP_SERVER_VARS['SERVER_ADDR'] == '127.0.0.1'; - } + return $_SERVER['SERVER_ADDR'] == '127.0.0.1'; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-14 17:52:38
|
Revision: 8464 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8464&view=rev Author: vargenau Date: 2012-11-14 17:52:31 +0000 (Wed, 14 Nov 2012) Log Message: ----------- Add brackets Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2012-11-14 17:41:10 UTC (rev 8463) +++ trunk/lib/stdlib.php 2012-11-14 17:52:31 UTC (rev 8464) @@ -422,8 +422,9 @@ // FIXED: This was broken for moniker:TP30 test/image.png => url="moniker:TP30" attr="test/image.png" $ori_url = $url; // support new syntax: [prefix/image.jpg size=50% border=n] - if (empty($alt)) $alt = ""; - + if (empty($alt)) { + $alt = ""; + } if (!IsSafeURL($url)) { $link = HTML::span(array('class' => 'error'), _('Bad URL for image -- remove all of <, >, "')); return $link; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-15 13:32:23
|
Revision: 8473 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8473&view=rev Author: vargenau Date: 2012-11-15 13:32:14 +0000 (Thu, 15 Nov 2012) Log Message: ----------- gettext --> __ Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2012-11-15 10:52:50 UTC (rev 8472) +++ trunk/lib/stdlib.php 2012-11-15 13:32:14 UTC (rev 8473) @@ -1938,7 +1938,7 @@ global $AllActionPages; - $localizedAllActionPages = array_map("gettext", $AllActionPages); + $localizedAllActionPages = array_map("__", $AllActionPages); return (in_array($filename, $localizedAllActionPages)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-15 13:34:01
|
Revision: 8474 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8474&view=rev Author: vargenau Date: 2012-11-15 13:33:52 +0000 (Thu, 15 Nov 2012) Log Message: ----------- Extract URL Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2012-11-15 13:32:14 UTC (rev 8473) +++ trunk/lib/stdlib.php 2012-11-15 13:33:52 UTC (rev 8474) @@ -425,6 +425,9 @@ if (empty($alt)) { $alt = ""; } + // Extract URL + $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 <, >, "')); return $link; @@ -432,13 +435,9 @@ // spaces in inline images must be %20 encoded! $link = HTML::img(array('src' => $url)); - // Extract attributes and shorten url - $arr = parse_attributes(strstr($url, " ")); + // Extract attributes + $arr = parse_attributes(strstr($ori_url, " ")); foreach ($arr as $attr => $value) { - // strip attr=... url suffix - $link->setAttr('src', $url); - $i = strpos($url, $attr); - $url = substr($url, 0, $i - 1); // These attributes take strings: lang, id, title, alt if (($attr == "lang") || ($attr == "id") @@ -489,7 +488,7 @@ } } // Correct silently the most common error - if (strstr($ori_url, " ") and !preg_match("/^http/", $url)) { + if ($url != $ori_url and empty($arr) and !preg_match("/^http/", $url)) { // space belongs to the path $file = NormalizeLocalFileName($ori_url); if (file_exists($file)) { @@ -1666,8 +1665,6 @@ } } - - // File globbing // expands a list containing regex's to its matching entries This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-06 06:51:29
|
Revision: 8608 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8608&view=rev Author: vargenau Date: 2012-12-06 06:51:23 +0000 (Thu, 06 Dec 2012) Log Message: ----------- Remove commented code Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2012-12-05 19:01:32 UTC (rev 8607) +++ trunk/lib/stdlib.php 2012-12-06 06:51:23 UTC (rev 8608) @@ -2296,9 +2296,6 @@ function charset_convert($from, $to, $data) { - //global $CHARSET; - //$wikicharset = strtolower($CHARSET); - //$systemcharset = strtolower(get_cfg_var('iconv.internal_encoding')); // 'iso-8859-1'; 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') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |