madhabkirank / google-api-adwords-php

Automatically exported from code.google.com/p/google-api-adwords-php
0 stars 0 forks source link

AuthToken class "split" function #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
GetToken method in AuthToken class uses "split" function which is 
deprecated as of php 5.3 in favor of preg_split.

70: $lines = split("\n", $this->res);

You should probably update it to something like this

70: $lines = preg_split("/\n/", $this->res, -1, PREG_SPLIT_NO_EMPTY);

Also, line 72 of AuthToken class reads

72: $parts = split('=', $line);

Wouldn't it make more sense to use "explode" function which doesn't incur 
the overhead of regular expression engine which is not needed in this case 
anyway.

$parts = explode('=', $line);

Original issue reported on code.google.com by evey...@gmail.com on 17 Dec 2009 at 5:54

GoogleCodeExporter commented 8 years ago
The library currently doesn't support PHP 5.3, but this is a good 
recommendation to 
make future compatibility easier.  Explode must be used with a limit in this 
case, 
since the authToken string may contain an equals sign as well.

Original comment by api.ekol...@gmail.com on 17 Dec 2009 at 8:45

GoogleCodeExporter commented 8 years ago

Original comment by api.ekol...@gmail.com on 19 Jan 2010 at 9:28

GoogleCodeExporter commented 8 years ago
This was fixed in version 1.2.2.

Original comment by api.ekol...@gmail.com on 20 Jan 2010 at 4:25