Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Thu May 11, 2023 2:44 am Reply with quote

When a user is trying to make a comment the fatal error is showing under the text. I noticed the editor is not working neither.

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /modules/Surveys/comments.php on line 696

Code:
while (list($key,) = each($AllowableHTML)) echo ' <' . $key . '>';


I tried to replace with this one

Code:
foreach($AllowableHTML as $key => $value){


     echo "$key"; //This displays the index of the element in the array
     echo "<". $value. ">"; //This displays the value
}


but no success,

I've got this error

Notice: Array to string conversion in

What could be the right solution then?

I could remove the line

Code:
echo '<p><span class="thick">' . _UCOMMENT . ':</span><br />'

         . '<textarea cols="50" rows="10" name="comment"></textarea></p>';
         . '<p>' . _ALLOWEDHTML . '<br />'
      while (list($key,) = each($AllowableHTML)) echo ' &lt;' . $key . '&gt;';


Replace with

Code:
echo '<p><span class="thick">' . _UCOMMENT . ':</span><br />'

         . '<textarea cols="50" rows="10" name="comment"></textarea></p>';
         //. '<p>' . _ALLOWEDHTML . '<br />';
      //while (list($key,) = each($AllowableHTML)) echo ' &lt;' . $key . '&gt;';


I don't think this option will be the right way. Just let me know guys!
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1774

PostPosted: Thu May 11, 2023 1:36 pm Reply with quote

Good catch, there are more codelines like this in different modules that cause the same message. The variable $AllowableHTML is a multidimensional array that we have to loop through several times.

Try this:

php Code:
foreach($AllowableHTML as $tags => $tag) {

echo ' &lt;', $tags;
foreach($tag as $attributes => $attribute) {
echo ' ', $attributes, '=""';
}
echo '&gt;<br />';
}


The output is shown like this. Make it sense for you?

Code:
Allowed HTML:

<a class="" style="" id="" href="" target="" title="">
<b>
<blockquote class="" style="" id="">
<br>
<center>
<div class="" style="" id="" align="">
<em class="" style="" id="">
<font face="" style="" color="" size="">
<h1 class="" style="" id="">
<h2 class="" style="" id="">
<h3 class="" style="" id="">
<h4 class="" style="" id="">
<h5 class="" style="" id="">
<h6 class="" style="" id="">
<hr>
<i>
<img class="" style="" id="" alt="" src="" hspace="" vspace="" width="" height="" border="" align="">
<li class="" style="" id="">
<ol class="" style="" id="">
<p class="" style="" id="" align="">
<pre style="" id="" align="" class="" title="">
<span id="" class="" style="">
<strong>
<strike>
<sub>
<sup>
<table class="" style="" id="" align="" border="" cell="" width="" cellspacing="" cellpadding="">
<tbody class="" style="" id="">
<td class="" style="" id="" align="" width="" valign="" height="" rowspan="" colspan="">
<tfoot class="" style="" id="">
<th class="" style="" id="" align="" scope="" width="" valign="" height="" rowspan="" colspan="">
<thead class="" style="" id="">
<tr class="" style="" id="" align="">
<tt>
<u>
<ul class="" style="" id="">


Please note: This is only a "quick and dirty" way to get the output. I have to play with it a bit to find maybe a more practical way to solve it.

_________________
Github: RavenNuke 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Fri May 12, 2023 2:39 am Reply with quote

Yes I got the same output. I guess u go in the right way. to do it.

I found out arround line 785 There is another line it could cause the same issue
Code:


   echo '</p><p><span class="thick">' . _SUBJECT . ':</span><br />'
      . '<input type="text" name="subject" size="50" maxlength="85" value="' . $subject . '" /></p>'
      . '<p><span class="thick">' . _UCOMMENT . ':</span><br />'
      . '<textarea cols="50" rows="10" name="comment">' . htmlentities($comment, ENT_QUOTES) . '</textarea></p>';
   echo '<p>' . _ALLOWEDHTML . '<br />';
   while (list($key,) = each($AllowableHTML)) echo ' &lt;' . $key . '&gt;';
   echo '</p>';
 
neralex







PostPosted: Sun May 14, 2023 6:16 pm Reply with quote

hicuxunicorniobestbuildpc wrote:
Yes I got the same output. I guess u go in the right way. to do it.


When it makes sense for you, why you don't change it in the same way?
 
hicuxunicorniobestbuildpc







PostPosted: Mon May 15, 2023 4:48 am Reply with quote

Yes I did it already. Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©