michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
339 stars 71 forks source link

stripslashe for text field #85

Closed lolozere closed 10 years ago

lolozere commented 10 years ago

I create a class extending AdminPageFramework_MetaBox_Page to add a textarea field. I tape this input data : capture decran 2014-03-18 a 13 54 04 but after saving a "\" was added : capture decran 2014-03-18 a 13 55 56 Is it possible to detect fix it ? I search a solution in the code to pull a request but I'am lost...

lolozere commented 10 years ago

Here a temporary code I wrote :

public function validation_RED_ThemeSettings($submitData, $oldSubmitData) {
            return $this->_traillingSlashes($submitData);
        }

        protected function _traillingSlashes($data) {
            if (is_string($data)) {
                $data = stripslashes($data);
            } elseif (is_array($data)) {
                foreach($data as $key => $value) {
                    $data[$key] = $this->_traillingSlashes($value);
                }
            }
            return $data;
        }
michaeluno commented 10 years ago

Can you post here the exact text that causes the problem so that I can try to reproduce it?

lolozere commented 10 years ago

The text was in the screen shot : '----------------- Chouette tu peux piquer le contenu :) J'adore '-----------------

michaeluno commented 10 years ago

I see. Thanks for the report. I updated the master branch with the fix. https://github.com/michaeluno/admin-page-framework/commit/971bac4bbd21c4b46975b139480a8ef72de326e4

lolozere commented 10 years ago

Thanks it's perfect, it's work.