I have a problem on my new video site, for which videos are pulled from YouTube. It appears that for one video+description, there's <a href> tag that is opened, but not termintaed. (line 266, col 347 (of the page source, not the internal code) I was told to convert HTML Special Characters into character codes instead before writing it to the browser. Unfortunately, I know nothing abot PHP, so I have no idea what to do.
You have to find the variable (beginning with $) of the description, and insert $variable_name = htmlspecialchars($variable_name); row before display it (search echo/print commands).
I can't really find the variable Based on the piece of code below, I assume it is $parse_desc ? // Make description short $parse_desc=explode(" ",$line['content']); if(count($parse_desc)>25){ $line['content']=""; for($p=0;$p<25;$p++){$line['content'].=$parse_desc[$p]." ";} $line['content']=trim($line['content'])."..."; } PHP:
Based on the code above, if you copy my line after the code, it should work. If it's not working I have no idea what is the problem, sorry.
It did work - I only had to be a bit more patient to see the result of the added code. Thanks a whole lot!
Maybe you should also run striptags function, but since this function have some issues the best way is to process description is with preg_replace function. Example: $dsc = preg_replace('<[^<>]+?', ' ', $dsc); Now you will get this: some text instead of this: <a href ..> some text But this will also remove all tags that are presented in text like bold (<b></b>), or italic (<i></i>).