Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
1ce861ab
Commit
1ce861ab
authored
Jan 30, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Jan 30, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Fix deprecated warning in BBCode library"
parents
6d6bf2f7
ede2859a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
htdocs/lib/stringparser_bbcode/stringparser.class.php
htdocs/lib/stringparser_bbcode/stringparser.class.php
+2
-2
htdocs/lib/stringparser_bbcode/stringparser_bbcode.class.php
htdocs/lib/stringparser_bbcode/stringparser_bbcode.class.php
+6
-6
No files found.
htdocs/lib/stringparser_bbcode/stringparser.class.php
View file @
1ce861ab
...
...
@@ -282,7 +282,7 @@ class StringParser {
StringParser_Node
::
destroyNode
(
$this
->
_root
);
}
unset
(
$this
->
_root
);
$this
->
_root
=
&
new
StringParser_Node_Root
();
$this
->
_root
=
new
StringParser_Node_Root
();
$this
->
_stack
[
0
]
=&
$this
->
_root
;
$this
->
_parserInit
();
...
...
@@ -979,7 +979,7 @@ class StringParser_Node {
function
appendToLastTextChild
(
$text
)
{
$ccount
=
count
(
$this
->
_children
);
if
(
$ccount
==
0
||
$this
->
_children
[
$ccount
-
1
]
->
_type
!=
STRINGPARSER_NODE_TEXT
)
{
$ntextnode
=
&
new
StringParser_Node_Text
(
$text
);
$ntextnode
=
new
StringParser_Node_Text
(
$text
);
return
$this
->
appendChild
(
$ntextnode
);
}
else
{
$this
->
_children
[
$ccount
-
1
]
->
appendText
(
$text
);
...
...
htdocs/lib/stringparser_bbcode/stringparser_bbcode.class.php
View file @
1ce861ab
...
...
@@ -564,7 +564,7 @@ class StringParser_BBCode extends StringParser {
return
true
;
}
if
(
$needle
==
'['
)
{
$node
=
&
new
StringParser_BBCode_Node_Element
(
$this
->
_cpos
);
$node
=
new
StringParser_BBCode_Node_Element
(
$this
->
_cpos
);
$res
=
$this
->
_pushNode
(
$node
);
if
(
!
$res
)
{
return
false
;
...
...
@@ -1207,7 +1207,7 @@ class StringParser_BBCode extends StringParser {
for
(
$i
=
0
;
$i
<
count
(
$sub_nodes
);
$i
++
)
{
if
(
!
$last_node_was_paragraph
||
(
$prevtype
==
$sub_nodes
[
$i
]
->
_type
&&
(
$i
!=
0
||
$prevtype
!=
STRINGPARSER_BBCODE_NODE_ELEMENT
)))
{
unset
(
$paragraph
);
$paragraph
=
&
new
StringParser_BBCode_Node_Paragraph
();
$paragraph
=
new
StringParser_BBCode_Node_Paragraph
();
}
$prevtype
=
$sub_nodes
[
$i
]
->
_type
;
if
(
$sub_nodes
[
$i
]
->
_type
!=
STRINGPARSER_BBCODE_NODE_ELEMENT
||
$sub_nodes
[
$i
]
->
getFlag
(
'paragraph_type'
,
'integer'
,
BBCODE_PARAGRAPH_ALLOW_BREAKUP
)
!=
BBCODE_PARAGRAPH_BLOCK_ELEMENT
)
{
...
...
@@ -1218,7 +1218,7 @@ class StringParser_BBCode extends StringParser {
$dest_nodes
[]
=&
$sub_nodes
[
$i
];
$last_onde_was_paragraph
=
false
;
unset
(
$paragraph
);
$paragraph
=
&
new
StringParser_BBCode_Node_Paragraph
();
$paragraph
=
new
StringParser_BBCode_Node_Paragraph
();
}
}
}
...
...
@@ -1261,7 +1261,7 @@ class StringParser_BBCode extends StringParser {
if
(
$node
->
_type
==
STRINGPARSER_NODE_TEXT
)
{
$cpos
=
0
;
while
((
$npos
=
strpos
(
$node
->
content
,
$detect_string
,
$cpos
))
!==
false
)
{
$subnode
=
&
new
StringParser_Node_Text
(
substr
(
$node
->
content
,
$cpos
,
$npos
-
$cpos
),
$node
->
occurredAt
+
$cpos
);
$subnode
=
new
StringParser_Node_Text
(
substr
(
$node
->
content
,
$cpos
,
$npos
-
$cpos
),
$node
->
occurredAt
+
$cpos
);
// copy flags
foreach
(
$node
->
_flags
as
$flag
=>
$value
)
{
if
(
$flag
==
'newlinemode.begin'
)
{
...
...
@@ -1278,7 +1278,7 @@ class StringParser_BBCode extends StringParser {
unset
(
$subnode
);
$cpos
=
$npos
+
strlen
(
$detect_string
);
}
$subnode
=
&
new
StringParser_Node_Text
(
substr
(
$node
->
content
,
$cpos
),
$node
->
occurredAt
+
$cpos
);
$subnode
=
new
StringParser_Node_Text
(
substr
(
$node
->
content
,
$cpos
),
$node
->
occurredAt
+
$cpos
);
if
(
$cpos
==
0
)
{
$value
=
$node
->
getFlag
(
'newlinemode.begin'
,
'integer'
,
null
);
if
(
$value
!==
null
)
{
...
...
@@ -1532,7 +1532,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
* @return object
*/
function
&
duplicate
()
{
$newnode
=
&
new
StringParser_BBCode_Node_Element
(
$this
->
occurredAt
);
$newnode
=
new
StringParser_BBCode_Node_Element
(
$this
->
occurredAt
);
$newnode
->
_name
=
$this
->
_name
;
$newnode
->
_flags
=
$this
->
_flags
;
$newnode
->
_attributes
=
$this
->
_attributes
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment