aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuckhtml.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fuckhtml.php')
-rw-r--r--lib/fuckhtml.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/fuckhtml.php b/lib/fuckhtml.php
index d89a7bc..ee1353c 100644
--- a/lib/fuckhtml.php
+++ b/lib/fuckhtml.php
@@ -381,6 +381,8 @@ class fuckhtml{
$json_out = null;
$last_char = null;
+ $keyword_check = null;
+
for($i=0; $i<strlen($json); $i++){
switch($json[$i]){
@@ -396,6 +398,7 @@ class fuckhtml{
$bracket = false;
$is_close_bracket = true;
+
}else{
if($bracket === false){
@@ -429,6 +432,31 @@ class fuckhtml{
$is_close_bracket === false
){
+ // do keyword check
+ $keyword_check .= $json[$i];
+
+ if(in_array($json[$i], [":", "{"])){
+
+ $keyword_check = substr($keyword_check, 0, -1);
+
+ if(
+ preg_match(
+ '/function|array|return/i',
+ $keyword_check
+ )
+ ){
+
+ $json_out =
+ preg_replace(
+ '/[{"]*' . preg_quote($keyword_check, "/") . '$/',
+ "",
+ $json_out
+ );
+ }
+
+ $keyword_check = null;
+ }
+
// here we know we're not iterating over a quoted string
switch($json[$i]){
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage