|
From: <ru...@us...> - 2009-03-24 14:00:05
|
Revision: 6697
http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6697&view=rev
Author: rurban
Date: 2009-03-24 13:59:59 +0000 (Tue, 24 Mar 2009)
Log Message:
-----------
Chrome does not display the addInfobox
Modified Paths:
--------------
trunk/lib/EditToolbar.php
trunk/lib/config.php
Modified: trunk/lib/EditToolbar.php
===================================================================
--- trunk/lib/EditToolbar.php 2009-03-24 13:27:56 UTC (rev 6696)
+++ trunk/lib/EditToolbar.php 2009-03-24 13:59:59 UTC (rev 6697)
@@ -63,7 +63,7 @@
$dbi = $GLOBALS['request']->getDbh();
// regenerate if number of pages changes (categories, pages, templates)
$key = $dbi->numPages();
- $key .= '+categories+plugin';
+ $key .= '+categories+plugin' . (isBrowserSafari() ? '+safari' : '');
if (TOOLBAR_PAGELINK_PULLDOWN) {
$key .= "+pages";
}
@@ -210,9 +210,12 @@
$title = addslashes( $tool["title"] );
$toolbar .= ("addTagButton('$image','$title','$open','$close','$sample');\n");
}
- $toolbar .= ("addInfobox('"
- . addslashes( _("Click a button to get an example text") )
- . "');\n");
+ /* Fails with Chrome */
+ if (!isBrowserSafari()) {
+ $toolbar .= ("addInfobox('"
+ . addslashes( _("Click a button to get an example text") )
+ . "');\n");
+ }
}
if (JS_SEARCHREPLACE) {
@@ -281,7 +284,10 @@
$categories = array();
while ($p = $pages->next()) {
$page = $p->getName();
- $categories[] = "['$page', '%5B%5B".$page."%5D%5D']";
+ if (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($page)))
+ $categories[] = "['$page', '%5B".$page."%5D']";
+ else
+ $categories[] = "['$page', '$page']";
}
if (!$categories) return '';
// Ensure this to be inserted at the very end. Hence we added the id to the function.
Modified: trunk/lib/config.php
===================================================================
--- trunk/lib/config.php 2009-03-24 13:27:56 UTC (rev 6696)
+++ trunk/lib/config.php 2009-03-24 13:59:59 UTC (rev 6697)
@@ -70,7 +70,7 @@
return $HTTP_USER_AGENT;
}
function browserDetect($match) {
- return strstr(strtolower(browserAgent()), strtolower($match));
+ return (strpos(strtolower(browserAgent()), strtolower($match)) !== false);
}
// returns a similar number for Netscape/Mozilla (gecko=5.0)/IE/Opera features.
function browserVersion() {
@@ -108,7 +108,8 @@
// MacOSX Safari has certain limitations. Need detection and patches.
// * no <object>, only <embed>
function isBrowserSafari($version = false) {
- $found = browserDetect('spoofer') or browserDetect('applewebkit');
+ $found = browserDetect('Spoofer/');
+ $found = browserDetect('AppleWebKit/') or $found;
if ($version) return $found and browserVersion() >= $version;
return $found;
}
@@ -324,6 +325,32 @@
return $loc;
}
+/** string pcre_fix_posix_classes (string $regexp)
+*
+* Older version (pre 3.x?) of the PCRE library do not support
+* POSIX named character classes (e.g. [[:alnum:]]).
+*
+* This is a helper function which can be used to convert a regexp
+* which contains POSIX named character classes to one that doesn't.
+*
+* All instances of strings like '[:<class>:]' are replaced by the equivalent
+* enumerated character class.
+*
+* Implementation Notes:
+*
+* Currently we use hard-coded values which are valid only for
+* ISO-8859-1. Also, currently on the classes [:alpha:], [:alnum:],
+* [:upper:] and [:lower:] are implemented. (The missing classes:
+* [:blank:], [:cntrl:], [:digit:], [:graph:], [:print:], [:punct:],
+* [:space:], and [:xdigit:] could easily be added if needed.)
+*
+* This is a hack. I tried to generate these classes automatically
+* using ereg(), but discovered that in my PHP, at least, ereg() is
+* slightly broken w.r.t. POSIX character classes. (It includes
+* "\xaa" and "\xba" in [:alpha:].)
+*
+* So for now, this will do. --Jeff <da...@da...> 14 Mar, 2001
+*/
function pcre_fix_posix_classes ($regexp) {
return $regexp;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|