create-prisma-php-app 1.16.29 → 1.16.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,9 @@ $isAjax = isAjaxRequest();
26
26
  $isWire = isWireRequest();
27
27
  $contentType = $_SERVER['CONTENT_TYPE'] ?? '';
28
28
  $requestedWith = $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '';
29
- $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
29
+ $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
30
+ (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') ||
31
+ $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
30
32
  $domainName = $_SERVER['HTTP_HOST'];
31
33
  $scriptName = dirname($_SERVER['SCRIPT_NAME']) . '/';
32
34
  $baseUrl = $protocol . $domainName . rtrim($scriptName, '/') . '/src/app/';
@@ -248,13 +248,17 @@ abstract class Utility
248
248
  case 'endsWith':
249
249
  case 'equals':
250
250
  case 'not':
251
- $validatedValue = Validator::string($val);
252
- $likeOperator = $condition === 'contains' ? ($dbType == 'pgsql' ? 'ILIKE' : 'LIKE') : '=';
253
- if ($condition === 'startsWith') $validatedValue .= '%';
254
- if ($condition === 'endsWith') $validatedValue = '%' . $validatedValue;
255
- if ($condition === 'contains') $validatedValue = '%' . $validatedValue . '%';
256
- $sqlConditions[] = $condition === 'not' ? "$fieldQuoted != $bindingKey" : "$fieldQuoted $likeOperator $bindingKey";
257
- $bindings[$bindingKey] = $validatedValue;
251
+ if ($val === null || $val === '') {
252
+ $sqlConditions[] = $condition === 'not' ? "$fieldQuoted IS NOT NULL" : "$fieldQuoted IS NULL";
253
+ } else {
254
+ $validatedValue = Validator::string($val);
255
+ $likeOperator = $condition === 'contains' ? ($dbType == 'pgsql' ? 'ILIKE' : 'LIKE') : '=';
256
+ if ($condition === 'startsWith') $validatedValue .= '%';
257
+ if ($condition === 'endsWith') $validatedValue = '%' . $validatedValue;
258
+ if ($condition === 'contains') $validatedValue = '%' . $validatedValue . '%';
259
+ $sqlConditions[] = $condition === 'not' ? "$fieldQuoted != $bindingKey" : "$fieldQuoted $likeOperator $bindingKey";
260
+ $bindings[$bindingKey] = $validatedValue;
261
+ }
258
262
  break;
259
263
  case 'gt':
260
264
  case 'gte':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.16.29",
3
+ "version": "1.16.30",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",