Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-12671

Possibility to use NOT LIKE expression

    Details

      Description

      Hi,

      When i look at this:
      https://github.com/phpbb/phpbb/blob/develop-ascraeus/phpBB/phpbb/db/driver/driver.php#L268

      I see it's (currently) not possible to use "NOT LIKE" statement.
      I'm thinking to add a second parameter which allow us to use NOT LIKE instead of LIKE.

      The result should look something like:

      $this->_sql_like_expression(($not_like ? 'NOT LIKE' : 'LIKE' ) . ' \'' . $this->sql_escape($expression) . '\'');

      I'll create a PR asap.

        Issue Links

          Activity

          Hide
          bantu Andreas Fischer added a comment -

          I am not sure this is actually necessary. You can just add the NOT prefix yourself.

          Show
          bantu Andreas Fischer added a comment - I am not sure this is actually necessary. You can just add the NOT prefix yourself.
          Hide
          Geolim4 Geolim4 added a comment - - edited

          I spoke to Joas and he said yes it's ok if i provide the PR, because currently if you prefix the NOT yourself, it will be sanitized with sql_escape() :/
          We have the same thing for sql_in_set(), why not with this method ?

          Show
          Geolim4 Geolim4 added a comment - - edited I spoke to Joas and he said yes it's ok if i provide the PR, because currently if you prefix the NOT yourself, it will be sanitized with sql_escape() :/ We have the same thing for sql_in_set(), why not with this method ?
          Hide
          bantu Andreas Fischer added a comment - - edited

          The parameters that sql_in_set has are a pretty bad since noone knows what they are for when reading them. Consider adding sql_not_like_expression($expression) instead.

          Show
          bantu Andreas Fischer added a comment - - edited The parameters that sql_in_set has are a pretty bad since noone knows what they are for when reading them. Consider adding sql_not_like_expression($expression) instead.
          Hide
          Geolim4 Geolim4 added a comment -

          The parameters that sql_in_set are a pretty bad idea since noone knows what they are for when reading them.

          We have to standardize that so ? In the PR can i also include a sql_not_in_set() and adding a deprecated message in the top of the sql_in_set() method?

          Show
          Geolim4 Geolim4 added a comment - The parameters that sql_in_set are a pretty bad idea since noone knows what they are for when reading them. We have to standardize that so ? In the PR can i also include a sql_not_in_set() and adding a deprecated message in the top of the sql_in_set() method?
          Hide
          nickvergessen Joas Schilling added a comment -

          Geolim4 no_in_set should be a different PR I guess

          Show
          nickvergessen Joas Schilling added a comment - Geolim4 no_in_set should be a different PR I guess
          Hide
          Geolim4 Geolim4 added a comment -

          ok

          Show
          Geolim4 Geolim4 added a comment - ok

            People

            • Assignee:
              nickvergessen Joas Schilling
              Reporter:
              Geolim4 Geolim4
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development