PageRenderTime 44ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/installer/composer-patches/text_wiki_mediawiki__php8fixes.patch

https://gitlab.com/ElvisAns/tiki
Patch | 231 lines | 221 code | 10 blank | 0 comment | 0 complexity | 18ec584e9e08c653c1bad8b1e8921587 MD5 | raw file
  1. diff --git a/Text/Wiki.php b/Text/Wiki.php
  2. index 647999e..aa83d57 100644
  3. --- a/Text/Wiki.php
  4. +++ b/Text/Wiki.php
  5. @@ -1037,7 +1037,7 @@ class Text_Wiki {
  6. for ($i = 0; $i < $k; $i++) {
  7. // the current character
  8. - $char = $this->source{$i};
  9. + $char = $this->source[$i];
  10. // are alredy in a delimited section?
  11. if ($in_delim) {
  12. diff --git a/Text/Wiki/Parse/BBCode/Colortext.php b/Text/Wiki/Parse/BBCode/Colortext.php
  13. index 5840043..d107eb6 100755
  14. --- a/Text/Wiki/Parse/BBCode/Colortext.php
  15. +++ b/Text/Wiki/Parse/BBCode/Colortext.php
  16. @@ -81,7 +81,7 @@ class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse {
  17. }
  18. // needs to withdraw leading # as renderer put it in
  19. - $color = $matches[1]{0} == '#' ? substr($matches[1], 1) : $matches[1];
  20. + $color = $matches[1][0] == '#' ? substr($matches[1], 1) : $matches[1];
  21. // builds the option array
  22. $options = array('type' => 'start', 'level' => $this->_level, 'color' => $color);
  23. diff --git a/Text/Wiki/Parse/BBCode/Url.php b/Text/Wiki/Parse/BBCode/Url.php
  24. index 7ae4ea8..0e19401 100644
  25. --- a/Text/Wiki/Parse/BBCode/Url.php
  26. +++ b/Text/Wiki/Parse/BBCode/Url.php
  27. @@ -143,7 +143,7 @@ class Text_Wiki_Parse_Url extends Text_Wiki_Parse {
  28. if ($matches[2] === '=') {
  29. $type = 'descr';
  30. } elseif ($matches[2]) {
  31. - $pre = $matches[1]{0};
  32. + $pre = $matches[1][0];
  33. }
  34. }
  35. $matches[2] = 'mailto:' . $matches[3];
  36. diff --git a/Text/Wiki/Parse/Cowiki/Paragraph.php b/Text/Wiki/Parse/Cowiki/Paragraph.php
  37. index 8a535ef..18c3acc 100644
  38. --- a/Text/Wiki/Parse/Cowiki/Paragraph.php
  39. +++ b/Text/Wiki/Parse/Cowiki/Paragraph.php
  40. @@ -112,7 +112,7 @@ class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
  41. $key = '';
  42. $len = strlen($matches[0]);
  43. for ($i = 1; $i < $len; $i++) {
  44. - $char = $matches[0]{$i};
  45. + $char = $matches[0][$i];
  46. if ($char == $delim) {
  47. break;
  48. } else {
  49. diff --git a/Text/Wiki/Parse/Cowiki/Wikilink.php b/Text/Wiki/Parse/Cowiki/Wikilink.php
  50. index d2c974f..dfcc9f3 100644
  51. --- a/Text/Wiki/Parse/Cowiki/Wikilink.php
  52. +++ b/Text/Wiki/Parse/Cowiki/Wikilink.php
  53. @@ -195,7 +195,7 @@ class Text_Wiki_Parse_Wikilink extends Text_Wiki_Parse {
  54. {
  55. // when prefixed with !, it's explicitly not a wiki link.
  56. // return everything as it was.
  57. - /*if ($matches[3]{0} == '!') {
  58. + /*if ($matches[3][0] == '!') {
  59. return $matches[1] . substr($matches[3], 1) . $matches[4] . $matches[7];
  60. }*/
  61. if (!isset($matches[4])) {
  62. diff --git a/Text/Wiki/Parse/Creole/Paragraph.php b/Text/Wiki/Parse/Creole/Paragraph.php
  63. index c286396..ad64516 100644
  64. --- a/Text/Wiki/Parse/Creole/Paragraph.php
  65. +++ b/Text/Wiki/Parse/Creole/Paragraph.php
  66. @@ -105,7 +105,7 @@ class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
  67. $key = '';
  68. $len = strlen($matches[0]);
  69. for ($i = 1; $i < $len; $i++) {
  70. - $char = $matches[0]{$i};
  71. + $char = $matches[0][$i];
  72. if ($char == $delim) {
  73. break;
  74. } else {
  75. diff --git a/Text/Wiki/Parse/Default/Smiley.php b/Text/Wiki/Parse/Default/Smiley.php
  76. index ce295b4..2e1d10b 100644
  77. --- a/Text/Wiki/Parse/Default/Smiley.php
  78. +++ b/Text/Wiki/Parse/Default/Smiley.php
  79. @@ -111,15 +111,15 @@ class Text_Wiki_Parse_Smiley extends Text_Wiki_Parse {
  80. $cur = $smiley;
  81. }
  82. $len = strlen($cur);
  83. - if (($cur{0} == ':') && ($len > 2) && ($cur{$len - 1} == ':')) {
  84. + if (($cur[0] == ':') && ($len > 2) && ($cur[$len - 1] == ':')) {
  85. $reg1 .= $sep1 . preg_quote(substr($cur, 1, -1), '#');
  86. $sep1 = '|';
  87. continue;
  88. }
  89. if ($autoNose && ($len === 2)) {
  90. - $variante = $cur{0} . '-' . $cur{1};
  91. + $variante = $cur[0] . '-' . $cur[1];
  92. $this->_smileys[$variante] = &$this->_smileys[$smiley];
  93. - $cur = preg_quote($cur{0}, '#') . '-?' . preg_quote($cur{1}, '#');
  94. + $cur = preg_quote($cur[0], '#') . '-?' . preg_quote($cur[1], '#');
  95. } else {
  96. $cur = preg_quote($cur, '#');
  97. }
  98. diff --git a/Text/Wiki/Parse/Default/Wikilink.php b/Text/Wiki/Parse/Default/Wikilink.php
  99. index 8a33e43..f0bafd1 100755
  100. --- a/Text/Wiki/Parse/Default/Wikilink.php
  101. +++ b/Text/Wiki/Parse/Default/Wikilink.php
  102. @@ -186,7 +186,7 @@ class Text_Wiki_Parse_Wikilink extends Text_Wiki_Parse {
  103. {
  104. // when prefixed with !, it's explicitly not a wiki link.
  105. // return everything as it was.
  106. - if ($matches[2]{0} == '!') {
  107. + if ($matches[2][0] == '!') {
  108. return $matches[1] . substr($matches[2], 1) . $matches[3];
  109. }
  110. diff --git a/Text/Wiki/Parse/Doku/Paragraph.php b/Text/Wiki/Parse/Doku/Paragraph.php
  111. index 8a535ef..18c3acc 100644
  112. --- a/Text/Wiki/Parse/Doku/Paragraph.php
  113. +++ b/Text/Wiki/Parse/Doku/Paragraph.php
  114. @@ -112,7 +112,7 @@ class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
  115. $key = '';
  116. $len = strlen($matches[0]);
  117. for ($i = 1; $i < $len; $i++) {
  118. - $char = $matches[0]{$i};
  119. + $char = $matches[0][$i];
  120. if ($char == $delim) {
  121. break;
  122. } else {
  123. diff --git a/Text/Wiki/Parse/Mediawiki/Table.php b/Text/Wiki/Parse/Mediawiki/Table.php
  124. index 0622ae0..2150d47 100644
  125. --- a/Text/Wiki/Parse/Mediawiki/Table.php
  126. +++ b/Text/Wiki/Parse/Mediawiki/Table.php
  127. @@ -260,7 +260,7 @@ class Text_Wiki_Parse_Table extends Text_Wiki_Parse {
  128. }
  129. $param = array(
  130. 'type' => 'cell_start',
  131. - 'attr' => $matches[1] && ($matches[1]{0} == '!') ? 'header': null,
  132. + 'attr' => $matches[1] && ($matches[1][0] == '!') ? 'header': null,
  133. 'span' => 1,
  134. 'rowspan' => 1,
  135. 'order' => $order
  136. diff --git a/Text/Wiki/Parse/Tiki/Paragraph.php b/Text/Wiki/Parse/Tiki/Paragraph.php
  137. index 410d512..0441649 100755
  138. --- a/Text/Wiki/Parse/Tiki/Paragraph.php
  139. +++ b/Text/Wiki/Parse/Tiki/Paragraph.php
  140. @@ -114,7 +114,7 @@ class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
  141. $key = '';
  142. $len = strlen($matches[0]);
  143. for ($i = 1; $i < $len; $i++) {
  144. - $char = $matches[0]{$i};
  145. + $char = $matches[0][$i];
  146. if ($char == $delim) {
  147. break;
  148. } else {
  149. diff --git a/Text/Wiki/Parse/Tiki/Plugin.php b/Text/Wiki/Parse/Tiki/Plugin.php
  150. index e70c201..dd1f46c 100644
  151. --- a/Text/Wiki/Parse/Tiki/Plugin.php
  152. +++ b/Text/Wiki/Parse/Tiki/Plugin.php
  153. @@ -115,7 +115,7 @@ class Text_Wiki_Parse_Plugin extends Text_Wiki_Parse {
  154. preg_match_all($this->regexArgs, $matches[2], $args, PREG_PATTERN_ORDER);
  155. $attr = array();
  156. foreach ($args[1] as $i=>$name) {
  157. - if ($args[2][$i]{0} == '"' || $args[2][$i]{0} == "'") {
  158. + if ($args[2][$i][0] == '"' || $args[2][$i][0] == "'") {
  159. $attr[$name] = substr($args[2][$i], 1, -1);
  160. } else {
  161. $attr[$name] = trim($args[2][$i]);
  162. diff --git a/Text/Wiki/Parse/Tiki/Wikilink.php b/Text/Wiki/Parse/Tiki/Wikilink.php
  163. index 3cb279e..14d17b1 100755
  164. --- a/Text/Wiki/Parse/Tiki/Wikilink.php
  165. +++ b/Text/Wiki/Parse/Tiki/Wikilink.php
  166. @@ -195,7 +195,7 @@ class Text_Wiki_Parse_Wikilink extends Text_Wiki_Parse {
  167. {
  168. // when prefixed with !, it's explicitly not a wiki link.
  169. // return everything as it was.
  170. - /*if ($matches[3]{0} == '!') {
  171. + /*if ($matches[3][0] == '!') {
  172. return $matches[1] . substr($matches[3], 1) . $matches[4] . $matches[7];
  173. }*/
  174. if (isset($matches[2]) && $matches[2] == '))' && isset($matches[5]) && $matches[5] == '((') {
  175. diff --git a/Text/Wiki/Render/Docbook/Colortext.php b/Text/Wiki/Render/Docbook/Colortext.php
  176. index b0ed39f..7b49870 100644
  177. --- a/Text/Wiki/Render/Docbook/Colortext.php
  178. +++ b/Text/Wiki/Render/Docbook/Colortext.php
  179. @@ -70,7 +70,7 @@ class Text_Wiki_Render_Docbook_Colortext extends Text_Wiki_Render {
  180. $color = $options['color'];
  181. if (!in_array($color, $this->getConf('colors', array())) &&
  182. - $color{0} != '#') {
  183. + $color[0] != '#') {
  184. $color = '#' . $color;
  185. }
  186. return '<phrase role="' . $this->getConf('role', 'color') . '" ' .
  187. diff --git a/Text/Wiki/Render/Docbook/Url.php b/Text/Wiki/Render/Docbook/Url.php
  188. index 1c42f19..2e012c7 100644
  189. --- a/Text/Wiki/Render/Docbook/Url.php
  190. +++ b/Text/Wiki/Render/Docbook/Url.php
  191. @@ -77,7 +77,7 @@ class Text_Wiki_Render_Docbook_Url extends Text_Wiki_Render {
  192. } else {
  193. // should we build a target clause?
  194. - if ($href{0} == '#' ||
  195. + if ($href[0] == '#' ||
  196. strtolower(substr($href, 0, 7)) == 'mailto:') {
  197. // targets not allowed for on-page anchors
  198. // and mailto: links.
  199. diff --git a/Text/Wiki/Render/Xhtml/Colortext.php b/Text/Wiki/Render/Xhtml/Colortext.php
  200. index d0298ab..e93c4a0 100755
  201. --- a/Text/Wiki/Render/Xhtml/Colortext.php
  202. +++ b/Text/Wiki/Render/Xhtml/Colortext.php
  203. @@ -63,7 +63,7 @@ class Text_Wiki_Render_Xhtml_Colortext extends Text_Wiki_Render {
  204. $type = $options['type'];
  205. $color = $options['color'];
  206. - if (! in_array($color, $this->colors) && $color{0} != '#') {
  207. + if (! in_array($color, $this->colors) && $color[0] != '#') {
  208. $color = '#' . $color;
  209. }
  210. diff --git a/Text/Wiki/Render/Xhtml/Url.php b/Text/Wiki/Render/Xhtml/Url.php
  211. index 794ba16..576fa51 100755
  212. --- a/Text/Wiki/Render/Xhtml/Url.php
  213. +++ b/Text/Wiki/Render/Xhtml/Url.php
  214. @@ -79,7 +79,7 @@ class Text_Wiki_Render_Xhtml_Url extends Text_Wiki_Render {
  215. } else {
  216. // should we build a target clause?
  217. - if ($href{0} == '#' ||
  218. + if ($href[0] == '#' ||
  219. strtolower(substr($href, 0, 7)) == 'mailto:') {
  220. // targets not allowed for on-page anchors
  221. // and mailto: links.