A
A
Anton2015-10-21 09:49:10
Kohana
Anton, 2015-10-21 09:49:10

Handler for kohana header, who uses what parameters?

Hello, who uses what parameters to process the title of products or news, etc.?
There was a problem in the title there are often different characters, for example, quotation marks "
Let's say? there is a heading Диван "Мойзе", when adding, what is in quotes is not added and it turns out that the heading (Sofa) is cut off to the first quote, what to do with it? Should I add these quotes to the title, will it affect search engines? etc.
At the moment I use the removal of extra spaces:

public function action_clean()
    {
        foreach (ORM::factory('product')->find_all() as $prod) {
            $name = $prod->prname;
            $name = str_replace('     ', ' ', $name);
            $name = str_replace('    ', ' ', $name);
            $name = str_replace('   ', ' ', $name);
            $name = str_replace('  ', ' ', $name);
            $prod->prname = $name;
            $prod->save();
        }

        return true;
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-10-21
Protko @Fesor

you have just found a sql injection vulnerability. Options:
1) prepared statements
2) escaping.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question