Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry BLIND2019-07-22 06:56:55 -0400
committerThierry BLIND2019-07-22 07:06:42 -0400
commit2886b9bb01a7b8d64bd394ae3d5a7ce47359100d (patch)
treeead221116bbff10c12967128d043007ad788bc90
parentd0a174080591d75dd3b5cc0fbba9679d190d8cdf (diff)
downloadorg.eclipse.pdt-2886b9bb01a7b8d64bd394ae3d5a7ce47359100d.tar.gz
org.eclipse.pdt-2886b9bb01a7b8d64bd394ae3d5a7ce47359100d.tar.xz
org.eclipse.pdt-2886b9bb01a7b8d64bd394ae3d5a7ce47359100d.zip
No bug - minor doc generator fixes
perform text replacements only once for a given value
-rw-r--r--plugins/org.eclipse.php.core/Resources/language/generate.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/org.eclipse.php.core/Resources/language/generate.php b/plugins/org.eclipse.php.core/Resources/language/generate.php
index a6cabf6d1..b881744bf 100644
--- a/plugins/org.eclipse.php.core/Resources/language/generate.php
+++ b/plugins/org.eclipse.php.core/Resources/language/generate.php
@@ -1058,12 +1058,12 @@ function print_doccomment ($ref, $tabs = 0) {
function xml_to_phpdoc ($str) {
$str = str_replace ("&return.success;", "Returns true on success or false on failure.", $str);
$str = str_replace ("&return.void;", "", $str);
- $str = str_replace("&Alias;", "Alias:", $str);
+ $str = str_replace ("&Alias;", "Alias:", $str);
// rewrite all non-html entities like "&null;", "&true;", "&false;"
// as "null", "true", "false"
preg_match_all ('@&([a-zA-Z0-9._-]+);@s', $str, $matches);
if ($matches) {
- foreach ($matches[1] as $v) {
+ foreach (array_unique ($matches[1]) as $v) {
if (html_entity_decode ("&" . $v . ";") === "&" . $v . ";") {
$str = str_replace ("&" . $v . ";", $v, $str);
}
@@ -1151,7 +1151,7 @@ function strip_tags_special ($str) {
$str = str_replace ("]]>", "###(/pre)###", $str);
preg_match_all ('@(<\?php.*?\?>)@si', $str, $matches);
if ($matches) {
- foreach ($matches[1] as $v) {
+ foreach (array_unique ($matches[1]) as $v) {
$str = str_replace ($v, "###(code)###" . strtr (htmlspecialchars ($v), array(
"/" => "&#47;",
"*" => "&#42;",

Back to the top