RemoveJavaScript::process()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Remove all JS code
4
 *
5
 * @author  Tim Lochmüller
6
 */
7
8
namespace FRUIT\Ink\Postprocessing;
9
10
/**
11
 * Remove all JS code
12
 */
13
class RemoveJavaScript implements PostprocessingInterface
14
{
15
16
    /**
17
     * Run the replacement
18
     *
19
     * @param string $content
20
     *
21
     * @return string
22
     * @todo remove also onchange etc.
23
     */
24
    public function process($content)
25
    {
26
        return preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content);
27
    }
28
}
29