Coder Social home page Coder Social logo

marc_test's People

Contributors

dave-jay avatar

Watchers

James Cloos avatar  avatar

marc_test's Issues

Task #1: Incorrect Result

Test Case:

jSort('01','1','0x1','1.0');

Expected result: 1.0,1,0x1,01
Actual result: 01,1,0x1,1.0

Task #5: Incorrect Result

Test case:

echo (truncateString('अधिलोकमधिज्यौतिषमधिविद्यमधिप्रजमध्यात्मम्', 10, '')), "\n";

Expected result:

अधिलोकमधिज

Actual result:

(empty string)

Task #4: Incorrect result

Please note this: "Also it is important that the <script> and <style> tags must be removed with all their content."

Therefore this:

<div><p align='left' onclick='alert(1)'>sample <b><i>text</i></b><script>alert(2);</script></p></div>

should be turned into this:

<p align = 'left' >sample <b>text</b></p>

not this:

<p align = 'left' >sample <b>text</b>alert(2);</p>

Task #4: Incorrect result (3)

$html = "<div><p align=left onclick='alert(1)'>sample <b><i>text</i></b><script type='text/javascript'>alert(2);</script></p></div>";
$allowed = array('b', 'p' => array('align'));

Actual result:

PHP Notice:  Undefined offset: 2 in /home/vladimir/work/github/marc_test/task4.php on line 52
<p align=left onclick='alert(1)'>sample <b>text</b></p>

Expected result:

<p align = 'left' >sample <b>text</b></p>

Same happens for

$html = "<div><p align=\"left\" onclick='alert(1)'>sample <b><i>text</i></b><script type='text/javascript'>alert(2);</script></p></div>";

Task #4: Incorrect result (2)

$html = "<div><p align='left' onclick='alert(1)'>sample <b><i>text</i></b><script type='text/javascript'>alert(2);</script></p></div>";
$allowed = array('b', 'p' => array('align'), 'script');

The expected result is

<p align='left'>sample <b>text</b></p>

The actual result is

<p align = 'left' >sample <b>text</b><script type='text/javascript'>alert(2);</script></p>

Please note this in the task requirements: _Also it is important that the <script> and <style> tags must be removed with all their content. This condition implies irrespective of the above conditions_

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.