pjg711 / oauth-php

Automatically exported from code.google.com/p/oauth-php
MIT License
0 stars 0 forks source link

missing return $s in sql_escape_string of OAuthStorePDO on line 211 #53

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Using SQL while PDO Store adapter

What is the expected output? What do you see instead?
Give The sql corrent

What version of the product are you using? On what operating system?
OAuth PHP library - revision 98 - 2010-03-07

Please provide any additional information below.

Missing return $s as shown below

    protected function sql_escape_string ( $s )
    {
        if (is_string($s))
        {
            $s = $this->conn->quote($s);
            // kludge. Quote already adds quotes, and this conflicts with OAuthStoreSQL.
            // so remove the quotes
            $len = mb_strlen($s);
            if ($len > 0)
                $s = mb_substr($s, 1, $len-1);
                     return $s; //Missing
        }
        else if (is_null($s))
        {
            return NULL;
        }
        else if (is_bool($s))
        {
            return intval($s);
        }
        else if (is_int($s) || is_float($s))
        {
            return $s;
        }
        else
        {
            return $this->conn->quote(strval($s));
        }
    }

Original issue reported on code.google.com by ntf...@gmail.com on 23 Jun 2010 at 7:41

GoogleCodeExporter commented 8 years ago
            if ($len > 0){
                $s = mb_substr($s, 1, $len-1);
                $s = mb_substr($s, 0 , $len-2); 
            }
            return $s;

Original comment by ntf...@gmail.com on 23 Jun 2010 at 7:45

GoogleCodeExporter commented 8 years ago
This has been fixed already in the latest SVN, with a more complete patch. 
Please try it... A new release is scheduled for July 1st.

Original comment by brunobg%...@gtempaccount.com on 23 Jun 2010 at 1:59