سلام کاربران عزیز!
امروز میخوام پلاگین تغییر سایز فونت چت روم رو بزارم براتون
که یکی از دوستان درخواست کرده
دمو:
لینک دانلود:
http://s5.picofile.com/file/8114203484/Font_wWw_plugin_chat_blogfa_com_.zip.html
در این پلاگین نیاز به فایل MessageInserter.class دارد .....
height: 400px</span><span style="color: rgb(0, 128, 0);"> </span><span style="background-color: rgb(0, 255, 0);">;</span> <span style="color: rgb(255, 0, 0);">width: 400px</span>"></span><span dir="ltr"><code><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(255, 128, 0);">// message style parameters<br /> </span><span style="color: rgb(0, 0, 187);">$style </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">"color:"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">htmlentities</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'color'</span><span style="color: rgb(0, 119, 0);">], </span><span style="color: rgb(0, 0, 187);">ENT_QUOTES</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(221, 0, 0);">"UTF-8"</span><span style="color: rgb(0, 119, 0);">).</span><span style="color: rgb(221, 0, 0);">"; font-family:"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'face'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">"; font-size:"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'yasersize'</span><span style="color: rgb(0, 119, 0);">].</span><span style="color: rgb(221, 0, 0);">"; font-weight:"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">htmlentities</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'bold'</span><span style="color: rgb(0, 119, 0);">], </span><span style="color: rgb(0, 0, 187);">ENT_QUOTES</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(221, 0, 0);">"UTF-8"</span><span style="color: rgb(0, 119, 0);">).</span><span style="color: rgb(221, 0, 0);">";font-size: 6px"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">htmlentities</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'italic'</span><span style="color: rgb(0, 119, 0);">], </span><span style="color: rgb(0, 0, 187);">ENT_QUOTES</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(221, 0, 0);">"UTF-8"</span><span style="color: rgb(0, 119, 0);">).</span><span style="color: rgb(221, 0, 0);">";"</span><span style="color: rgb(0, 119, 0);">; </span></span></code></code>
مشکل این کد اینه که باگCSS و فونت درشت رو باز میکنه و افراد میتونند با هک فونت بزرگ توی چت روم متن بزرگ بفرستن .....
چت رو ها برای جلوگیری از هک فونت درشت چت روم ها از کد زیر استفاده میکنند
<code><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);"><br /></span><span style="color: rgb(255, 128, 0);">// message style parameters<br /> </span><span style="color: rgb(0, 0, 187);">$__italic</span><span style="color: rgb(0, 119, 0);">;</span><span style="color: rgb(0, 0, 187);">$__bold</span><span style="color: rgb(0, 119, 0);">;</span><span style="color: rgb(0, 0, 187);">$__color</span><span style="color: rgb(0, 119, 0);">;<br /> </span><span style="color: rgb(0, 0, 187);">$__POSTEDCOLOR </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'color'</span><span style="color: rgb(0, 119, 0);">];<br /> if(</span><span style="color: rgb(0, 0, 187);">preg_match</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'{^#}'</span><span style="color: rgb(0, 119, 0);">,</span><span style="color: rgb(0, 0, 187);">$__POSTEDCOLOR</span><span style="color: rgb(0, 119, 0);">) && (</span><span style="color: rgb(0, 0, 187);">strlen</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$__POSTEDCOLOR</span><span style="color: rgb(0, 119, 0);">) <= </span><span style="color: rgb(0, 0, 187);">10</span><span style="color: rgb(0, 119, 0);">)){</span><span style="color: rgb(0, 0, 187);">$__color</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(0, 0, 187);">$__POSTEDCOLOR</span><span style="color: rgb(0, 119, 0);">;}else{</span><span style="color: rgb(0, 0, 187);">$__color</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">'red'</span><span style="color: rgb(0, 119, 0);">;}<br /> if(</span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'bold'</span><span style="color: rgb(0, 119, 0);">] == </span><span style="color: rgb(221, 0, 0);">"bold"</span><span style="color: rgb(0, 119, 0);">){</span><span style="color: rgb(0, 0, 187);">$__bold</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">"bold"</span><span style="color: rgb(0, 119, 0);">;}else{</span><span style="color: rgb(0, 0, 187);">$__bold</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">'normal'</span><span style="color: rgb(0, 119, 0);">;}<br /> if(</span><span style="color: rgb(0, 0, 187);">$_POST</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'italic'</span><span style="color: rgb(0, 119, 0);">]==</span><span style="color: rgb(221, 0, 0);">"italic"</span><span style="color: rgb(0, 119, 0);">){</span><span style="color: rgb(0, 0, 187);">$__italic</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">"italic"</span><span style="color: rgb(0, 119, 0);">;}else{</span><span style="color: rgb(0, 0, 187);">$__italic</span><span style="color: rgb(0, 119, 0);">=</span><span style="color: rgb(221, 0, 0);">'normal'</span><span style="color: rgb(0, 119, 0);">;}<br /> </span><span style="color: rgb(0, 0, 187);">$style </span><span style="color: rgb(0, 119, 0);">= </span><span style="color: rgb(221, 0, 0);">"color:"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$__color</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">";font-weight:"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$__bold</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">";font-style:"</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">$__italic</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(221, 0, 0);">";"</span><span style="color: rgb(0, 119, 0);">; </span></span></code></code></p><p><code><code></code></co
لطفا این کد رو با کد اولیه خودتون تلفیق کنید تا پلاگین انتخاب سایز و فونت بدون باگ کار بکنه
نظرات شما عزیزان: