Jump to content

what do i need to do to make the code mountain safe and mountain good


egemen

Recommended Posts

<?php
class pt
{
    private function ar()
    {
        $data = array();
        foreach ($_POST as $key => $value) {
            $data[$key] = $value;
        }
        return $data;
    }

    private function em($value)
    {
        $tf = false; // Set the default value to false
        if (!empty($value)) {
            $tf = true;
        }
        return $tf;
    }

    private function ff($value)
    {
        $n = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
        $m = htmlentities($n, ENT_QUOTES, 'UTF-8');
        $s = addslashes($m);
        $y = strip_tags($s);
        $z = $y;
        return $z;
    }

    private function bh($key, $z)
    {
        $array = array(); // Create an empty array
        $array[$key] = $z; // Add the value $z to the 'key' key
        $ar = $array;
        return $ar;
    }

    public function bb($ar)
    {
        return $ar;
    }
    /*
    private function bod()
    {
        $result = $this->ar(); // Call the ar() method and assign the result to the $result variable
        $key = array_keys($result); // Get the keys of the $result array
        $value = array_values($result); // Get the values of the $result array
        $z = $value[0]; // Assign the first value of the $value array to the $z variable
        return array($key[0] => $z); // Return an array with the first key $key[0] and value $z
    }

    public function db()
    {
        $result = $this->ar(); // Call the ar() method and assign the result to the $result variable
        $this->bb(); // Call the bb() method
        $this->bod(); // Call the bod() method
        return $result;
    }*/
    
}

 

Link to comment
Share on other sites

Huh?

What is 'mountain safe' or 'mountain good'?  Never heard of those terms on a forum.

As for the ar function:  What's the point?  You have a $_POST array already so why do you need to make a new array?

And then you create the em function just to find out if a value is empty.  Why does one need a function for that when PHP gives the empty function to use already?

And your  bh function.  Not at all sure what you are trying to do but what you have is going to simply create a single element array (?) with a key and a value that you already know and that you could have put into an array on your own.  This function doesn't do anything.  And it also creates an extra array just so you can return it.  Why?

And the bb function.    I won't even discuss that one.  Nor the commented code.

Edited by ginerjm
  • Thanks 1
Link to comment
Share on other sites

56 dakika önce ginerjm dedi ki:

,

In order to minimize post process vulnerabilities and the Hellenic-purpose project is safe, we get an average of 5 information from a form, for example closing post process vulnerabilities, for example xss vulnerabilities.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.