Skip to content

Commit

Permalink
Remove workaround for PHP bug #49692
Browse files Browse the repository at this point in the history
PHP bug #49692 [1] affects only PHP 5.3.0 and was fixed in PHP 5.3.1.
I think it is time to remove the workaround as PHP version 5.3.0 is
end-of-life for a long time now and even Debian old-stable comes with
PHP 5.3.3.

[1] <http://bugs.php.net/bug.php?id=49692>
  • Loading branch information
andreashaerter committed Feb 8, 2014
1 parent 284378d commit 9de0850
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 161 deletions.
8 changes: 0 additions & 8 deletions README
Expand Up @@ -24,16 +24,8 @@


See the monobook template website for update instructions [2]. See the monobook template website for update instructions [2].


NOTE: If everything will be displayed unformatted, your PHP environment is
probably affected by PHP bug #49692 [3]. You may find errors like
"syntax error, unexpected '/' in ../../lib/tpl/monobook/style.ini on
line XX" in your PHP logs when this is the case. monobook provides a
workaround for this, simply delete monobook's "style.ini" to trigger
the template to use it.

[1] <https://www.dokuwiki.org/template> [1] <https://www.dokuwiki.org/template>
[2] <https://www.dokuwiki.org/template:monobook#update> [2] <https://www.dokuwiki.org/template:monobook#update>
[3] <http://bugs.php.net/bug.php?id=49692>






Expand Down
120 changes: 0 additions & 120 deletions bug49642.php

This file was deleted.

19 changes: 5 additions & 14 deletions main.php
Expand Up @@ -140,8 +140,8 @@
* NOTE: This function is heavily inspired by "writeMBPortlet(), context.php" of * NOTE: This function is heavily inspired by "writeMBPortlet(), context.php" of
* the "Monobook for Dokuwiki" template by Terence J. Grant. * the "Monobook for Dokuwiki" template by Terence J. Grant.
* *
* @param array The tab data to render within the snippet. Each element * @param array The tab data to render within the snippet. Each element is
* is represented through a subarray: * represented by a subarray:
* $array = array("tab1" => array("text" => "hello world!", * $array = array("tab1" => array("text" => "hello world!",
* "href" => "http://www.example.com" * "href" => "http://www.example.com"
* "nofollow" => true), * "nofollow" => true),
Expand Down Expand Up @@ -281,7 +281,7 @@ function _monobook_renderTabs($arr)
* the "Monobook for Dokuwiki" template by Terence J. Grant. * the "Monobook for Dokuwiki" template by Terence J. Grant.
* *
* @param array The box data to render within the snippet. Each box is * @param array The box data to render within the snippet. Each box is
* represented through a subarray: * represented by a subarray:
* $array = array("box-id1" => array("headline" => "hello world!", * $array = array("box-id1" => array("headline" => "hello world!",
* "xhtml" => "I am <i>here</i>.")); * "xhtml" => "I am <i>here</i>."));
* Available keys within the subarrays: * Available keys within the subarrays:
Expand Down Expand Up @@ -361,8 +361,8 @@ function _monobook_renderBoxes($arr)
/** /**
* Helper to render the footer buttons (like a dynamic XHTML snippet) * Helper to render the footer buttons (like a dynamic XHTML snippet)
* *
* @param array The button data to render within the snippet. Each element * @param array The button data to render within the snippet. Each element is
* is represented through a subarray: * represented by a subarray:
* $array = array("btn1" => array("img" => DOKU_TPL."static/img/button-monobook.png", * $array = array("btn1" => array("img" => DOKU_TPL."static/img/button-monobook.png",
* "href" => "https://andreashaerter.com/", * "href" => "https://andreashaerter.com/",
* "width" => 80, * "width" => 80,
Expand Down Expand Up @@ -473,15 +473,6 @@ function _monobook_renderButtons($arr)
tpl_metaheaders(); tpl_metaheaders();
echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />"; echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />";


//manually load needed CSS? this is a workaround for PHP Bug #49642. In some
//version/os combinations PHP is not able to parse INI-file entries if there
//are slashes "/" used for the keynames (see bugreport for more information:
//<http://bugs.php.net/bug.php?id=49692>). to trigger this workaround, simply
//delete/rename monobook's style.ini.
if (!file_exists(DOKU_TPLINC."style.ini")){
echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."bug49642.php".((!empty($lang["direction"]) && $lang["direction"] === "rtl") ? "?langdir=rtl" : "")."\" />\n"; //var comes from DokuWiki core
}

//include default or userdefined favicon //include default or userdefined favicon
// //
//note: since 2011-04-22 "Rincewind RC1", there is a core function named //note: since 2011-04-22 "Rincewind RC1", there is a core function named
Expand Down
9 changes: 0 additions & 9 deletions mediamanager.php
Expand Up @@ -33,15 +33,6 @@
tpl_metaheaders(); tpl_metaheaders();
echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />"; echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />";


//manually load needed CSS? this is a workaround for PHP Bug #49642. In some
//version/os combinations PHP is not able to parse INI-file entries if there
//are slashes "/" used for the keynames (see bugreport for more information:
//<http://bugs.php.net/bug.php?id=49692>). to trigger this workaround, simply
//delete/rename monobook's style.ini.
if (!file_exists(DOKU_TPLINC."style.ini")){
echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."bug49642.php".((!empty($lang["direction"]) && $lang["direction"] === "rtl") ? "?langdir=rtl" : "")."\" />\n"; //var comes from DokuWiki core
}

//include default or userdefined favicon //include default or userdefined favicon
// //
//note: since 2011-04-22 "Rincewind RC1", there is a core function named //note: since 2011-04-22 "Rincewind RC1", there is a core function named
Expand Down
10 changes: 0 additions & 10 deletions style.ini
Expand Up @@ -27,8 +27,6 @@


[stylesheets] [stylesheets]
; screen ; screen
; note to myself: don't forget to respect the workaround within "bug49642.php"
; when adding new screen styles.
; load the DokuWiki styles. See <http://j.mp/eq8zSo> why I am doing this. ; load the DokuWiki styles. See <http://j.mp/eq8zSo> why I am doing this.
static/3rd/dokuwiki/_imgdetail.css = screen static/3rd/dokuwiki/_imgdetail.css = screen
static/3rd/dokuwiki/_media_popup.css = screen static/3rd/dokuwiki/_media_popup.css = screen
Expand Down Expand Up @@ -60,8 +58,6 @@ user/screen.css = screen
; I think this function is silly (cause therefore we got ; I think this function is silly (cause therefore we got
; different "media" but some people *always* searching for such ; different "media" but some people *always* searching for such
; print version links). Good text about this: <http://j.mp/6r3Kgf> ; print version links). Good text about this: <http://j.mp/6r3Kgf>
; note to myself: don't forget to respect the workaround within "bug49642.php"
; when adding new print styles.
; load the DokuWiki styles. See <http://j.mp/eq8zSo> why I am doing this. ; load the DokuWiki styles. See <http://j.mp/eq8zSo> why I am doing this.
static/3rd/dokuwiki/print.css = print static/3rd/dokuwiki/print.css = print


Expand All @@ -74,9 +70,6 @@ user/print.css = print




; right-to-left ; right-to-left
; note to myself: don't forget to respect the workaround within "bug49642.php"
; when adding new rtl styles.

; load the most important MediaWiki monobook styles ; load the most important MediaWiki monobook styles
static/3rd/monobook/rtl.css = rtl static/3rd/monobook/rtl.css = rtl


Expand All @@ -95,9 +88,6 @@ user/rtl.css = rtl
;-------------------------------------------------------------------------- ;--------------------------------------------------------------------------
;------ guaranteed dokuwiki color placeholders that every plugin can use ;------ guaranteed dokuwiki color placeholders that every plugin can use
; main text and background colors ; main text and background colors
;
;note to myself: don't forget to respect the workaround within "bug49642.php"
; when changing values in here.
__text__ = "#000" __text__ = "#000"
__background__ = "#fff" __background__ = "#fff"
; alternative text and background colors ; alternative text and background colors
Expand Down

0 comments on commit 9de0850

Please sign in to comment.