2017-03-03 6 views
0

私は簡単なコードhtmlを作成しました。製品の説明にはonmouseover、私はprestashopを使用しますが、このコードをprestashopに変更して保存すると、多くのタグをスキップします...これは私が作成したHTMLです:タグhtml onmouseover for prestashop

<!doctype html> 
 
<html> 
 
<head> 
 
\t <title></title> 
 
</head> 
 
<body> 
 
<center> 
 
<div id="sx">&nbsp; 
 
<center> 
 
<div id="wrapper"> 
 
<center> 
 
<div id="content"> 
 
<center><br /> 
 
<br /> 
 
&nbsp; 
 
<table align="center" border="0" width="700"> 
 
\t <tbody> 
 
\t \t <tr> 
 
\t \t \t <td align="center" rowspan="2" style="width: 20%; background-color: rgb(0, 0, 0);"><font color="#000000" face="Verdana" size="3"><img alt="Joomoda" onmouseover="document.mainpic.src='https://dstreet.pl/data/gfx/pictures/large/1/8/681_7.jpg'" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_7.jpg 
 
" style="border: 1px solid rgb(68, 68, 68); width: 155px; height: 200px;" /> <img alt="Joomoda" onmouseover="document.mainpic.src='https://dstreet.pl/data/gfx/pictures/large/1/8/681_1.jpg'" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_1.jpg 
 
" style="border: 1px solid rgb(68, 68, 68); width: 155px; height: 200px;" /><img alt="Joomoda" onmouseover="document.mainpic.src='https://dstreet.pl/data/gfx/pictures/large/1/8/681_5.jpg'" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_5.jpg 
 
" style="border: 1px solid rgb(68, 68, 68); width: 155px; height: 200px;" /> </font></td> 
 
\t \t \t <td align="center" rowspan="2" style="width: 20%; background-color: rgb(0, 0, 0);"><img alt="Joomoda" onmouseover="document.mainpic.src='https://dstreet.pl/data/gfx/pictures/large/1/8/681_4.jpg'" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_4.jpg 
 
" style="font-family: Verdana; border: 1px solid rgb(68, 68, 68); width: 155px; height: 200px;" /><img alt="Joomoda" onmouseover="document.mainpic.src='https://dstreet.pl/data/gfx/pictures/large/1/8/681_3.jpg'" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_3.jpg 
 
" style="font-family: Verdana; border: 1px solid rgb(68, 68, 68); width: 155px; height: 200px;" /><img alt="Joomoda" onmouseover="document.mainpic.src='https://dstreet.pl/data/gfx/pictures/large/1/8/681_2.jpg'" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_2.jpg 
 
" style="font-family: Verdana; border: 1px solid rgb(68, 68, 68); width: 155px; height: 200px;" /></td> 
 
\t \t \t <td align="center" style="background-color: rgb(0, 0, 0);"><font color="#000000" face="Verdana" size="3"><img align="absmiddle" name="mainpic" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_7.jpg" style="max-height: 612px; border-width: 4px; border-style: solid; margin: 2px; width: 435px; height: 560px;" /></font></td> 
 
\t \t </tr> 
 
\t \t <tr> 
 
\t \t \t <td align="center" style="background-color: rgb(255, 255, 255); height: 40px; border-color: rgb(0, 0, 0); vertical-align: middle;"><span style="font-size:26px;"><strong>FELPA UOMO BX0060</strong></span></td> 
 
\t \t </tr> 
 
\t </tbody> 
 
</table> 
 
</center> 
 
</div> 
 
</center> 
 
</div> 
 
</center> 
 
</div> 
 
</center> 
 
</body> 
 
</html>

、これは私が保存したときに私をPrestaShopの返すHTMLコードです:

<table align="center" border="0" style="width: 700px;" class=" cke_show_border"> 
 
<tbody> 
 
<tr> 
 
<td rowspan="2" style="background-color: #000000; width: 20%;"><img alt="Joomoda" data-cke-saved-src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_7.jpg 
 
" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_7.jpg 
 
" style="border: 1px solid #444444; height: 200px; width: 155px;" /> <img alt="Joomoda" data-cke-saved-src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_1.jpg 
 
" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_1.jpg 
 
" style="border: 1px solid #444444; height: 200px; width: 155px;" /><img alt="Joomoda" data-cke-saved-src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_5.jpg 
 
" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_5.jpg 
 
" style="border: 1px solid #444444; height: 200px; width: 155px;" /></td> 
 
<td rowspan="2" style="background-color: #000000; width: 20%;"><img alt="Joomoda" data-cke-saved-src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_4.jpg 
 
" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_4.jpg 
 
" style="border: 1px solid #444444; font-family: verdana; height: 200px; width: 155px;" /><img alt="Joomoda" data-cke-saved-src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_3.jpg 
 
" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_3.jpg 
 
" style="border: 1px solid #444444; font-family: verdana; height: 200px; width: 155px;" /><img alt="Joomoda" data-cke-saved-src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_2.jpg 
 
" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_2.jpg 
 
" style="border: 1px solid #444444; font-family: verdana; height: 200px; width: 155px;" /></td> 
 
<td style="background-color: #000000;"><img data-cke-saved-src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_7.jpg" src="https://dstreet.pl/data/gfx/pictures/large/1/8/681_7.jpg" style="border-style: solid; border-width: 4px; height: 560px; margin: 2px; max-height: 612px; width: 435px;" /></td> 
 
</tr> 
 
<tr> 
 
<td style="background-color: #ffffff; border-color: #000000; height: 40px; vertical-align: middle;"><span style="font-size: 26px;"><strong>FELPA UOMO BX0060</strong></span></td> 
 
</tr> 
 
</tbody> 
 
</table>

prestashopと互換性のあるこのようなコードを作成してください。

Thans

あなたは、メニュー設定でHTML清浄機をオフにする必要がありアンドレア

+0

ここで「保存」していますか? – sadlyblue

+0

PrestaShopのここ – Andrea

+0

における製品の説明で、あなたは [リンク](http://www.joomoda.com/felpe-uomo/1591-felpa-uomo-djm681.html) – Andrea

答えて

0

- >一般。 これはコードの削除を防止するだけですが、onmouseoverがフィールドに入ることは受け付けません。これを実現するには、ValidateクラスのisCleanHtml関数をオーバーライドするのが最善の方法です。

<?php 
class Validate extends ValidateCore 
{ 
    public static function isCleanHtml($html, $allow_iframe = false) 
    { 
     $events = 'onmousedown|onmousemove|onmmouseup|onmouseout|onload|onunload|onfocus|onblur|onchange'; 
     $events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend'; 
     $events .= '|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onmove'; 
     $events .= '|onbounce|oncellchange|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondeactivate|ondrag|ondragend|ondragenter|onmousewheel'; 
     $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart'; 
     $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange'; 
     $events .= '|onselectstart|onstart|onstop'; 

     if (preg_match('/<[\s]*script/ims', $html) || preg_match('/('.$events.')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) { 
      return false; 
     } 

     if (!$allow_iframe && preg_match('/<[\s]*(i?frame|form|input|embed|object)/ims', $html)) { 
      return false; 
     } 

     return true; 
    } 
} 

ファイルキャッシュ/ class_index.phpを削除します。それをもう一度保存してみてください。

この関数の内容は、onmouseoverを検索することを除いて、以前と同じコードを防止します。

+0

こんにちは結果見ることができ、助けてくれてありがとう、私はファイルphpを作成し、私はファイルキャッシュ/override/classes/cache/index.phpを削除しました 彼は私に説明の内容が無効であることを私に言った最初の試みは、その後、私は再び保存しようとしましたが、今、作成されたHTMLコードを直接削除し、通常のエディタで作成した最初の部分だけを残します。 – Andrea