svn: /php/php-src/ branches/PHP_5_3/ext/filter/logical_filters.c branches/PHP_5_4/ext/filter/logical_filters.c trunk/ext/filter/logical_filters.c
| From: | Felipe Pena | Date: | Tue, 24 May 2011 22:34:07 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/ext/filter/logical_filters.c branches/PHP_5_4/ext/filter/logical_filters.c trunk/ext/filter/logical_filters.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-65027@lists.php.net to get a copy of this message | ||
felipe Tue, 24 May 2011 22:34:07 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=311403
Log:
- Fix logic, it must check for both flags (as says the comment in the code) (bug #54912)
Bug: http://bugs.php.net/54912 (Closed)
filter/logical_filters.c:685:32: warning: use of logical || with constant op.
Changed paths:
U php/php-src/branches/PHP_5_3/ext/filter/logical_filters.c
U php/php-src/branches/PHP_5_4/ext/filter/logical_filters.c
U php/php-src/trunk/ext/filter/logical_filters.c
Modified: php/php-src/branches/PHP_5_3/ext/filter/logical_filters.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/filter/logical_filters.c 2011-05-24 22:24:06 UTC (rev 311402)
+++ php/php-src/branches/PHP_5_3/ext/filter/logical_filters.c 2011-05-24 22:34:07 UTC (rev 311403)
@@ -682,7 +682,7 @@
RETURN_VALIDATION_FAILED
}
- if (flags & (FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
+ if ((flags & FILTER_FLAG_IPV4) && (flags & FILTER_FLAG_IPV6)) {
/* Both formats are cool */
} else if ((flags & FILTER_FLAG_IPV4) && mode == FORMAT_IPV6) {
RETURN_VALIDATION_FAILED
Modified: php/php-src/branches/PHP_5_4/ext/filter/logical_filters.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/filter/logical_filters.c 2011-05-24 22:24:06 UTC (rev 311402)
+++ php/php-src/branches/PHP_5_4/ext/filter/logical_filters.c 2011-05-24 22:34:07 UTC (rev 311403)
@@ -682,7 +682,7 @@
RETURN_VALIDATION_FAILED
}
- if (flags & (FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
+ if ((flags & FILTER_FLAG_IPV4) && (flags & FILTER_FLAG_IPV6)) {
/* Both formats are cool */
} else if ((flags & FILTER_FLAG_IPV4) && mode == FORMAT_IPV6) {
RETURN_VALIDATION_FAILED
Modified: php/php-src/trunk/ext/filter/logical_filters.c
===================================================================
--- php/php-src/trunk/ext/filter/logical_filters.c 2011-05-24 22:24:06 UTC (rev 311402)
+++ php/php-src/trunk/ext/filter/logical_filters.c 2011-05-24 22:34:07 UTC (rev 311403)
@@ -682,7 +682,7 @@
RETURN_VALIDATION_FAILED
}
- if (flags & (FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
+ if ((flags & FILTER_FLAG_IPV4) && (flags & FILTER_FLAG_IPV6)) {
/* Both formats are cool */
} else if ((flags & FILTER_FLAG_IPV4) && mode == FORMAT_IPV6) {
RETURN_VALIDATION_FAILED