Project

General

Profile

Bug #20866 » replacetest.php

php-file to verify PHP error - Bernd Wilke, 2012-05-09 17:42

 
<?php

$text = '&quot;Die geistigen Wurzeln unserer ökonomischen Krise&quot;<br />Was wir im Umgang mit Geld, Arbeit und Konsum vom Buddhismus lernen können - Erfahrungen des Netzwerks Achtsame Wirtschaft<br />'
.'<br />'
.'Achtsamkeit gilt im Buddhismus als königlicher Geisteszustand, der uns hilft uns selbst und unser Umfeld klar zu sehen. Wie ändert sich unsere Wirtschaft, wenn wir unsere Arbeit, unseren Konsum und unseren Umgang mit Geld klarer sehen und verstehen, wenn wir achtsamer wirtschaften? Wirtschaft geschieht uns nicht! Wirtschaft ist kein autarkes System, das außerhalb unser selbst existiert. Wir sind es, die täglich kaufen und verkaufen, sparen und Schulden machen, arbeiten oder nicht arbeiten. Wir sind es, die Bedürfnisse entwickeln und befriedigen, die unzufrieden sind oder zufrieden durchs Leben gehen. Wir sind es, die maßvoll oder maßlos konsumieren und bewusst oder unbewusst kaufen. Die aktuelle ökonomische Krise wurzelt in unserem eigenen Geist. Verstehen wir die tieferliegenden Wurzeln unseres Handelns, werden wir frei, unheilsame Wirtschaftsaktivitäten zu beenden und unserer Wirtschaft eine heilsamere Richtung zu geben. <br />'
.'<br />'
.'Der Vortrag zeigt, wie wir durch die Kultivierung von Achtsamkeit und buddhistischer Geistesschulung zu heilsamen Alternativen im Feld der Wirtschaft gelangen. Hierzu werden konkrete Erfahrungen von Mitgliedern des Netzwerks Achtsame Wirtschaft vorgestellt, die seit Jahren im Umgang mit Geld, Konsum und Arbeit neue Wege gehen und ihre wirtschaftlichen Rollen als Unternehmer, Arbeitnehmer, Investoren oder Unternehmensberater neu definieren. <br />'
.'<br />'
.'Dr. Kai Romhardt<br />'
.'Gründer des Netzwerkes Achtsame Wirtschaft, Dharma-und Meditationslehrer, Unternehmensberater, Buchautor von „Wir sind die Wirtschaft“<br />'
.'Mehr Infos unter: www.achtsame-wirtschaft.de&nbsp; und www.romhardt.com&nbsp;';


echo '<h1>begin</h1><pre>';
var_dump(htmlspecialchars($text));
echo '</pre>';
/*

// original with other formating:

$text2 = preg_replace(
array(
"'<script[^>]*?>.*?</script[^>]*?>'si",
"'<applet[^>]*?>.*?</applet[^>]*?>'si",
"'<object[^>]*?>.*?</object[^>]*?>'si",
"'<iframe[^>]*?>.*?</iframe[^>]*?>'si",
"'<frameset[^>]*?>.*?</frameset[^>]*?>'si",
"'<style[^>]*?>.*?</style[^>]*?>'si",
"'<marquee[^>]*?>.*?</marquee[^>]*?>'si",
"'<script[^>]*?>'si",
"'<meta[^>]*?>'si",
"'<base[^>]*?>'si",
"'<applet[^>]*?>'si",
"'<object[^>]*?>'si",
"'<link[^>]*?>'si",
"'<iframe[^>]*?>'si",
"'<frame[^>]*?>'si",
"'<frameset[^>]*?>'si",
"'<input[^>]*?>'si",
"'<form[^>]*?>'si",
"'<embed[^>]*?>'si",
"'background-image:url'si",
"'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll|onselect|onselectstart|onsubmit|onunload).*?>'si"
),
'',
$text
);
*/

// split up in single replacements and output afterwards
$text2 = preg_replace("'<script[^>]*?>.*?</script[^>]*?>'si",'',$text);
echo '<h1>1</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<applet[^>]*?>.*?</applet[^>]*?>'si",'',$text);
echo '<h1>2</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<object[^>]*?>.*?</object[^>]*?>'si",'',$text);
echo '<h1>3</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<iframe[^>]*?>.*?</iframe[^>]*?>'si",'',$text);
echo '<h1>4</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<frameset[^>]*?>.*?</frameset[^>]*?>'si",'',$text);
echo '<h1>5</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<style[^>]*?>.*?</style[^>]*?>'si",'',$text);
echo '<h1>6</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<marquee[^>]*?>.*?</marquee[^>]*?>'si",'',$text);
echo '<h1>7</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<script[^>]*?>'si",'',$text);
echo '<h1>8</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<meta[^>]*?>'si",'',$text);
echo '<h1>9</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<base[^>]*?>'si",'',$text);
echo '<h1>10</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<applet[^>]*?>'si",'',$text);
echo '<h1>11</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<object[^>]*?>'si",'',$text);
echo '<h1>12</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<link[^>]*?>'si",'',$text);
echo '<h1>13</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<iframe[^>]*?>'si",'',$text);
echo '<h1>14</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<frame[^>]*?>'si",'',$text);
echo '<h1>15</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<frameset[^>]*?>'si",'',$text);
echo '<h1>16</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<input[^>]*?>'si",'',$text);
echo '<h1>17</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<form[^>]*?>'si",'',$text);
echo '<h1>18</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<embed[^>]*?>'si",'',$text);
echo '<h1>19</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'background-image:url'si",'',$text);
echo '<h1>20</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';


// last 'single' replacement
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll|onselect|onselectstart|onsubmit|onunload).*?>'si",'',$text);
echo '<h1>21g</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';


// each variant in a single replacement:
$text2 = preg_replace("'<\w+.*?onabort.*?>'si",'',$text);
echo '<h1>21</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onbeforeunload.*?>'si",'',$text);
echo '<h1>22</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onblur.*?>'si",'',$text);
echo '<h1>23</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onchange.*?>'si",'',$text);
echo '<h1>24</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onclick.*?>'si",'',$text);
echo '<h1>25</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?ondblclick.*?>'si",'',$text);
echo '<h1>26</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?ondragdrop.*?>'si",'',$text);
echo '<h1>27</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onerror.*?>'si",'',$text);
echo '<h1>28</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onfilterchange.*?>'si",'',$text);
echo '<h1>29</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onfocus.*?>'si",'',$text);
echo '<h1>30</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onhelp.*?>'si",'',$text);
echo '<h1>31</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onkeydown.*?>'si",'',$text);
echo '<h1>32</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onkeypress.*?>'si",'',$text);
echo '<h1>33</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onkeyup.*?>'si",'',$text);
echo '<h1>34</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onload.*?>'si",'',$text);
echo '<h1>35</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onmousedown.*?>'si",'',$text);
echo '<h1>36</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onmousemove.*?>'si",'',$text);
echo '<h1>37</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onmouseout.*?>'si",'',$text);
echo '<h1>38</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onmouseover.*?>'si",'',$text);
echo '<h1>39</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onmouseup.*?>'si",'',$text);
echo '<h1>40</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onmove.*?>'si",'',$text);
echo '<h1>41</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onreadystatechange.*?>'si",'',$text);
echo '<h1>42</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onreset.*?>'si",'',$text);
echo '<h1>43</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onresize.*?>'si",'',$text);
echo '<h1>44</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onscroll.*?>'si",'',$text);
echo '<h1>45</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onselect.*?>'si",'',$text);
echo '<h1>46</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onselectstart.*?>'si",'',$text);
echo '<h1>47</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onsubmit.*?>'si",'',$text);
echo '<h1>48</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?onunload.*?>'si",'',$text);
echo '<h1>49</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';

// each time one variant more
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload).*?>'si",'',$text);
echo '<h1>21p2</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur).*?>'si",'',$text);
echo '<h1>21p3</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange).*?>'si",'',$text);
echo '<h1>21p4</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick).*?>'si",'',$text);
echo '<h1>21p5</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick).*?>'si",'',$text);
echo '<h1>21p6</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop).*?>'si",'',$text);
echo '<h1>21p7</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror).*?>'si",'',$text);
echo '<h1>21p8</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange).*?>'si",'',$text);
echo '<h1>21p9</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus).*?>'si",'',$text);
echo '<h1>21p10</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp).*?>'si",'',$text);
echo '<h1>21p11</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown).*?>'si",'',$text);
echo '<h1>21p12</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress).*?>'si",'',$text);
echo '<h1>21p13</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup).*?>'si",'',$text);
echo '<h1>21p14</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload).*?>'si",'',$text);
echo '<h1>21p15</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown).*?>'si",'',$text);
echo '<h1>21p16</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove).*?>'si",'',$text);
echo '<h1>21p17</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout).*?>'si",'',$text);
echo '<h1>21p18</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover).*?>'si",'',$text);
echo '<h1>21p19</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup).*?>'si",'',$text);
echo '<h1>21p20</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove).*?>'si",'',$text);
echo '<h1>21p21</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange).*?>'si",'',$text);
echo '<h1>21p22</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset).*?>'si",'',$text);
echo '<h1>21p23</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize).*?>'si",'',$text);
echo '<h1>21p24</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll).*?>'si",'',$text);
echo '<h1>21p25</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll|onselect).*?>'si",'',$text);
echo '<h1>21p26</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll|onselect|onselectstart).*?>'si",'',$text);
echo '<h1>21p27</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll|onselect|onselectstart|onsubmit).*?>'si",'',$text);
echo '<h1>21p28</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';
$text2 = preg_replace("'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll|onselect|onselectstart|onsubmit|onunload).*?>'si",'',$text);
echo '<h1>21p29</h1><pre>'; var_dump(htmlspecialchars($text2)); echo '</pre>';


echo '<h1>between</h1><pre>';
var_dump(htmlspecialchars($text2));
echo '</pre>';

$text2 = preg_replace(
'/<a[^>]*href[[:space:]]*=[[:space:]]*["\']?[[:space:]]*javascript[^>]*/i',
'',
$text
);
echo '<h1>end</h1><pre>';
var_dump(htmlspecialchars($text2));
echo '</pre>';
// Return clean content



?>
(2-2/3)