Your project should not commit sensitive files to the repository

More information: https://insight.symfony.com/what-we-analyse/git.sensitive_file_committed

New rule! We've recently added this rule to Insight. Don't be surprised to see new suggestions even though the codebase didn't change.
The sensitive file cacert.pem is committed to the repository and may expose credentials or private keys.
Time to fix: about 2 hours
Read doc Open Issue Permalink Copy Prompt
Collective
  • Core/ClicShopping/External
    • vendor
    • CommonCurrencies.json
    • PasswordHash.php
    • cacert.pem

      The sensitive file cacert.pem is committed to the repository and may expose credentials or private keys.

    • cert_key_pem_paypal.txt
    • update-cacert.sh
  • gyakutsuki

    Ignored on Wed, 22 Apr 2026 12:34:13 GMT

Your project uses dangerous command injection functions 16

More information: https://insight.symfony.com/what-we-analyse/php.use_command_injection_function

New rule! We've recently added this rule to Insight. Don't be surprised to see new suggestions even though the codebase didn't change.
  1. }
  2. if (isset($_POST['download'])) {
  3. switch ($compress) {
  4. case 'gzip':
  5. exec(LOCAL_EXE_GZIP . ' ' . $backup_directory . $backup_file);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. $backup_file .= '.gz';
  7. break;
  8. case 'zip':
  9. exec(LOCAL_EXE_ZIP . ' -j ' . $backup_directory . $backup_file . '.zip ' . $backup_directory . $backup_file);
  10. unlink($backup_directory . $backup_file);
  • gyakutsuki

    not vulnerabilities here
  1. case 'gzip':
  2. exec(LOCAL_EXE_GZIP . ' ' . $backup_directory . $backup_file);
  3. $backup_file .= '.gz';
  4. break;
  5. case 'zip':
  6. exec(LOCAL_EXE_ZIP . ' -j ' . $backup_directory . $backup_file . '.zip ' . $backup_directory . $backup_file);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  7. unlink($backup_directory . $backup_file);
  8. $backup_file .= '.zip';
  9. }
  10. header('Content-type: application/x-octet-stream');
  • gyakutsuki

    not vulnerabilities here
  1. exit;
  2. } else {
  3. switch ($compress) {
  4. case 'gzip':
  5. exec(LOCAL_EXE_GZIP . ' ' . $backup_directory . $backup_file);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. break;
  7. case 'zip':
  8. exec(LOCAL_EXE_ZIP . ' -j ' . $backup_directory . $backup_file . '.zip ' . $backup_directory . $backup_file);
  9. unlink($backup_directory . $backup_file);
  10. }
  • gyakutsuki

    not vulnerabilities here
  1. switch ($compress) {
  2. case 'gzip':
  3. exec(LOCAL_EXE_GZIP . ' ' . $backup_directory . $backup_file);
  4. break;
  5. case 'zip':
  6. exec(LOCAL_EXE_ZIP . ' -j ' . $backup_directory . $backup_file . '.zip ' . $backup_directory . $backup_file);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  7. unlink($backup_directory . $backup_file);
  8. }
  9. $CLICSHOPPING_MessageStack->add(CLICSHOPPING::getDef('success_database_saved'), 'success');
  10. }
  • gyakutsuki

    not vulnerabilities here
  1. $restore_from = $restore_file;
  2. $remove_raw = false;
  3. break;
  4. case '.gz':
  5. $restore_from = substr($restore_file, 0, -3);
  6. exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  7. $remove_raw = true;
  8. break;
  9. case 'zip':
  10. $restore_from = substr($restore_file, 0, -4);
  11. exec(LOCAL_EXE_UNZIP . ' ' . $restore_file . ' -d ' . $backup_directory);
  • gyakutsuki

    not vulnerabilities here
  1. exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from);
  2. $remove_raw = true;
  3. break;
  4. case 'zip':
  5. $restore_from = substr($restore_file, 0, -4);
  6. exec(LOCAL_EXE_UNZIP . ' ' . $restore_file . ' -d ' . $backup_directory);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  7. $remove_raw = true;
  8. }
  9. if (isset($restore_from) && is_file($restore_from) && filesize($restore_from) > 15000) {
  10. $fd = fopen($restore_from, 'rb');
  • gyakutsuki

    not vulnerabilities here
  1. 2 => ["pipe", "w"] // stderr
  2. ];
  3. $this->logger->info('Starting MCP server process', ['command' => $command]);
  4. $this->process = proc_open($command, $descriptorspec, $this->pipes);
    proc_open() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  5. if (!is_resource($this->process)) {
  6. $this->logger->error('Failed to start MCP server process', ['command' => $command]);
  7. throw new McpConnectionException('Failed to start MCP server process');
  8. }
  • gyakutsuki

    not vulnerabilities here
  1. $CLICSHOPPING_Db = Registry::get('Db');
  2. $Qdate = $CLICSHOPPING_Db->query('select now() as datetime');
  3. try {
  4. [$system, $host, $kernel] = preg_split('/[\s,]+/', @exec('uname -a'), 5);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  5. } catch (\Throwable $e) {
  6. $system = $host = $kernel = 'unavailable';
  7. }
  8. try {
  • gyakutsuki

    not vulnerabilities here
  1. } catch (\Throwable $e) {
  2. $system = $host = $kernel = 'unavailable';
  3. }
  4. try {
  5. $uptime = @exec('uptime');
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. } catch (\Throwable $e) {
  7. $uptime = 'unavailable';
  8. }
  9. try {
  • gyakutsuki

    not vulnerabilities here
  1. if (!self::checkExecEnabled()) {
  2. return false;
  3. }
  4. $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer --no-ansi --no-interaction show 2>/dev/null';
  5. exec($cmd, $output, $return);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. return $return === 0;
  7. }
  8. /**
  • gyakutsuki

    not vulnerabilities here
  1. if (is_null($library) || !self::checkExecute()) {
  2. return false;
  3. }
  4. $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer show ' . escapeshellarg($library) . ' 2>/dev/null';
  5. exec($cmd, $output, $return);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. return $return === 0;
  7. }
  8. /**
  9. * Verifies if the necessary conditions for executing commands are met.
  • gyakutsuki

    not vulnerabilities here
  1. if (!self::checkExecute() || is_null($library)) {
  2. return false;
  3. }
  4. $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer show ' . escapeshellarg($library) . ' 2>/dev/null';
  5. exec($cmd, $output, $return);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. if ($return === 0 && !empty($output)) {
  7. // Recherche la ligne contenant la version
  8. foreach ($output as $line) {
  9. if (str_starts_with($line, 'versions')) {
  • gyakutsuki

    not vulnerabilities here
  1. if ($library !== null) {
  2. $cmd .= ' ' . escapeshellarg($library);
  3. }
  4. $cmd .= ' 2>&1';
  5. exec($cmd, $output, $return);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. // Retourne toute la sortie pour plus d'informations, ou une chaîne vide si rien
  7. return !empty($output) ? implode("\n", $output) : '';
  8. }
  • gyakutsuki

    not vulnerabilities here
  1. if (!self::checkExecute() || is_null($library)) {
  2. return false;
  3. }
  4. $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer require ' . escapeshellarg($library) . ' 2>&1';
  5. exec($cmd, $output, $return);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. return !empty($output) ? implode("\n", $output) : '';
  7. }
  8. /**
  • gyakutsuki

    not vulnerabilities here
  1. if (!self::checkExecute() || is_null($library)) {
  2. return '';
  3. }
  4. $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer remove ' . escapeshellarg($library) . ' 2>&1';
  5. exec($cmd, $output, $return);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. return !empty($output) ? implode("\n", $output) : '';
  7. }
  8. /**
  • gyakutsuki

    not vulnerabilities here
  1. if (!self::checkExecute()) {
  2. return '';
  3. }
  4. $cmd = 'cd ' . escapeshellarg(self::$root) . ' && composer clearcache 2>&1';
  5. exec($cmd, $output, $return);
    exec() is vulnerable to command injection attacks. Use the Symfony Process component instead.
    Last edited by ClicShopping
  6. // Retourne toute la sortie pour plus d'informations, ou une chaîne vide si rien
  7. return !empty($output) ? implode("\n", $output) : '';
  8. }
  9. }
  • gyakutsuki

    not vulnerabilities here

Your project uses non-strict array lookups 296

More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup

  1. */
  2. public static function checkExecEnabled(): bool
  3. {
  4. $disabled = explode(', ', ini_get('disable_functions'));
  5. return !in_array('exec', $disabled);
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. /**
  8. * Checks if Composer is installed and accessible in the current environment.
  9. *
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. exit;
  2. }
  3. // Validate feedback_type
  4. $validTypes = ['positive', 'negative', 'correction'];
  5. if (!in_array($input['feedback_type'], $validTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. echo json_encode([
  7. 'success' => false,
  8. 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
  9. ]);
  10. exit;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $errors = [];
  2. // ============================================================================
  3. // 1. Reset Translation Cache
  4. // ============================================================================
  5. if (in_array('translations', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $translationCache = new TranslationCache();
  8. // Count files before
  9. $cacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Translation/';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 3. Reset Classification Cache
  4. // ============================================================================
  5. if (in_array('classification', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $classificationCache = new ClassificationCache();
  8. // Get stats before
  9. $statsBefore = $classificationCache->getStatistics();
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 3. Reset Database Query Cache
  4. // ============================================================================
  5. if (in_array('database', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $db = Registry::get('Db');
  8. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  9. // Count entries before
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 4. Reset Schema Query Cache (TASK 5 - ITEM 1)
  4. // ============================================================================
  5. if (in_array('schema', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count schema cache files before (new location)
  8. $schemaCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/SchemaQuery/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 5. Reset Intent Classification Cache (TASK 5.1.7.6)
  4. // ============================================================================
  5. if (in_array('intent', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count intent cache files before (new location - all files)
  8. $intentCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Intent/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 6. Reset Ambiguity Cache (TASK 4 - Cache Migration)
  4. // ============================================================================
  5. if (in_array('ambiguity', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count ambiguity cache files before (new location - all files)
  8. $ambiguityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Ambiguity/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 7. Reset Translation Ambiguity Cache
  4. // ============================================================================
  5. if (in_array('translation_ambiguity', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count translation ambiguity cache files before (new location)
  8. $translationAmbiguityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Translation/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 8. Reset Context Cache
  4. // ============================================================================
  5. if (in_array('context', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count context cache files before (new location)
  8. $contextCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Context/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 8.5. Reset Memory Cache (file-based)
  4. // ============================================================================
  5. if (in_array('memory', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $memoryCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Memory/';
  8. $filesBefore = 0;
  9. if (is_dir($memoryCacheDir)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 9. Reset Embedding Cache
  4. // ============================================================================
  5. if (in_array('embedding', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count embedding cache files before (new location)
  8. $embeddingCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Embedding/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 10. Reset EmbeddingSearch Cache
  4. // ============================================================================
  5. if (in_array('embedding_search', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count embedding search cache files before (new location)
  8. $embeddingSearchCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/EmbeddingSearch/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 11. Reset Hybrid Query Cache (TASK 8: Multi-temporal query caching)
  4. // ============================================================================
  5. if (in_array('hybrid', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count hybrid cache files before
  8. $hybridCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Hybrid/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 12. Reset Semantic Query Cache (TASK 8: Multi-temporal query caching)
  4. // ============================================================================
  5. if (in_array('semantic', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. // Count hybrid cache files before
  8. $semanticCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Semantic/';
  9. $filesBefore = 0;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 13. Reset Embeddings Cache (PHASE 2 - NewVector cache)
  4. // ============================================================================
  5. if (in_array('embeddings', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $embeddingsCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Embeddings/';
  8. $filesBefore = 0;
  9. if (is_dir($embeddingsCacheDir)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 14. Reset SQL Query Cache (PHASE 4)
  4. // ============================================================================
  5. if (in_array('sql', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $sqlCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/SQL/';
  8. $filesBefore = 0;
  9. if (is_dir($sqlCacheDir)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 15. Reset Security Cache
  4. // ============================================================================
  5. if (in_array('security', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $securityCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Security/';
  8. $filesBefore = 0;
  9. if (is_dir($securityCacheDir)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 16. Reset Reputation Cache
  4. // ============================================================================
  5. if (in_array('reputation', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $reputationCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Reputation/';
  8. $filesBefore = 0;
  9. if (is_dir($reputationCacheDir)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // ============================================================================
  3. // 17. Reset Config Cache
  4. // ============================================================================
  5. if (in_array('config', $cacheTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. try {
  7. $configCacheDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Work/Cache/Rag/Config/';
  8. $filesBefore = 0;
  9. if (is_dir($configCacheDir)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. unset($this->storage[$scopedKey]);
  2. unset($this->metadata[$scopedKey]);
  3. // Remove from the scope's key list
  4. $scopeKeys = $this->scopes[$this->currentScope] ?? [];
  5. $index = array_search($scopedKey, $scopeKeys);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($index !== false) {
  7. array_splice($this->scopes[$this->currentScope], $index, 1);
  8. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. // Use higher priority
  2. $priorities = ['low' => 1, 'medium' => 2, 'high' => 3, 'critical' => 4];
  3. $priority1 = $priorities[$obj1->getPriority()];
  4. $priority2 = $priorities[$obj2->getPriority()];
  5. $combinedPriority = array_search(max($priority1, $priority2), $priorities);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. // Estimate combined time (not just sum, as there may be synergies)
  7. $estimatedTime = (int)(($obj1->getEstimatedCompletionTime() + $obj2->getEstimatedCompletionTime()) * 0.8);
  8. return [
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. private function translateMonthName(string $monthName, string $languageCode): string
  2. {
  3. $englishMonths = ['January', 'February', 'March', 'April', 'May', 'June',
  4. 'July', 'August', 'September', 'October', 'November', 'December'];
  5. $monthIndex = array_search(ucfirst(strtolower($monthName)), $englishMonths);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($monthIndex === false) {
  7. return $monthName; // Return as-is if not found
  8. }
  9. $targetMonths = $this->getMonthNames($languageCode);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if ($field === $idColumn) {
  2. return true;
  3. }
  4. // Exclude system timestamp fields
  5. if (in_array($field, ['created_at', 'updated_at', 'deleted_at'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. return false;
  7. }
  8. // Get column type
  9. $type = $columnTypes[$field] ?? 'string';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. // Get column type
  2. $type = $columnTypes[$field] ?? 'string';
  3. // Include numeric columns (for aggregation)
  4. if (in_array($type, ['int', 'bigint', 'smallint', 'decimal', 'float', 'double'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  5. return true;
  6. }
  7. // Include date/timestamp columns (for temporal analysis)
  8. if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (in_array($type, ['int', 'bigint', 'smallint', 'decimal', 'float', 'double'])) {
  2. return true;
  3. }
  4. // Include date/timestamp columns (for temporal analysis)
  5. if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. return true;
  7. }
  8. // Include text columns (for filtering and grouping)
  9. if (in_array($type, ['varchar', 'char', 'text', 'enum'])) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (in_array($type, ['date', 'datetime', 'timestamp', 'time'])) {
  2. return true;
  3. }
  4. // Include text columns (for filtering and grouping)
  5. if (in_array($type, ['varchar', 'char', 'text', 'enum'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. return true;
  7. }
  8. // Exclude everything else (binary, blob, json, etc.)
  9. return false;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. // Prefer 'normalized'; fall back to 'normalized_value' for forward-compat
  2. $scoreDescription = (float) ($factor['normalized'] ?? $factor['normalized_value'] ?? 0.0);
  3. }
  4. }
  5. $finalQuadrant = in_array($quadrant, ['Q1', 'Q2', 'Q3', 'Q4']) ? $quadrant : 'Q_intermediate';
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. return [
  7. 'quadrant' => $finalQuadrant,
  8. 'score_x' => (float) ($scoreXResult['score'] ?? 0.0),
  9. 'score_y' => (float) ($scoreYResult['score'] ?? 0.0),
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $fields = DoctrineOrm::getTableColumns($tableName);
  2. // Exclude only ID and system timestamp fields
  3. return array_values(array_filter($fields, function($field) use ($idColumn) {
  4. return $field !== $idColumn
  5. && !in_array($field, ['created_at', 'updated_at', 'deleted_at']);
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }));
  7. } catch (\Exception $e) {
  8. return [];
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $words = preg_split('/[\s,.:;!?"()]+/u', mb_strtolower($onlyText), -1, PREG_SPLIT_NO_EMPTY);
  2. $grammar = $this->grammar();
  3. $counts = [];
  4. foreach ($words as $w) {
  5. $w = preg_replace('/[^\p{L}\p{N}\-]/u', '', $w);
  6. if (mb_strlen($w) > 2 && !in_array($w, $grammar)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. $counts[$w] = ($counts[$w] ?? 0) + 1;
  8. }
  9. }
  10. arsort($counts);
  11. $report['wordcountmax'] = array_slice($counts, 0, 8, true);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $productData = $this->getProductData($productId);
  2. if ($productData && !$productData['in_stock']) {
  3. $messages[] = [
  4. 'type' => 'error',
  5. 'code' => 'out_of_stock',
  6. 'param' => '$.line_items[' . array_search($lineItem, $lineItems) . ']',
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. 'content_type' => 'plain',
  8. 'content' => 'Produit ' . $productData['title'] . ' temporairement indisponible'
  9. ];
  10. }
  11. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ECOMMERCE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ECOMMERCE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_ARCHIVE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_ARCHIVE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. // make sure no duplicate category IDs exist which could lock the server in a loop
  2. $tmp_array = [];
  3. $n = count($cPath_array);
  4. for ($i = 0; $i < $n; $i++) {
  5. if (!in_array($cPath_array[$i], $tmp_array)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $tmp_array[] = $cPath_array[$i];
  7. }
  8. }
  9. return $tmp_array;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $category_name = $this->getCategoryTreeTitle($category['name']);
  2. $categories_url = $this->getCategoryTreeUrl($category_link);
  3. if (($this->follow_cpath === true) && in_array($category_id, $this->cpath_array)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  4. $link_title = $this->cpath_start_string . $category_name . $this->cpath_end_string;
  5. } else {
  6. $link_title = $category_name;
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $result .= $this->parent_end_string;
  2. }
  3. if (isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
  4. if ($this->follow_cpath === true) {
  5. if (in_array($category_id, $this->cpath_array)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $result .= $this->_buildBranch($category_id, $level + 1);
  7. }
  8. } else {
  9. $result .= $this->_buildBranch($category_id, $level + 1);
  10. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_CATEGORIES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_CATEGORIES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $categories_id = HTML::sanitize($this->Id);
  2. $new_parent_id = HTML::sanitize($this->moveToCategoryID);
  3. $path = explode('_', $this->categoriesAdmin->getGeneratedCategoryPathIds($new_parent_id));
  4. if (\in_array($this->Id, $path)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $CLICSHOPPING_MessageStack->add($this->app->getDef('error_cannot_move_directory_to_parent'), 'error');
  6. $this->app->redirect('Categories&cPath=' . $this->cPath . '&cID=' . $categories_id);
  7. } else {
  8. $sql_array = [
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_MANUFACTURERS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_MANUFACTURERS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CATALOG_PRODUCTS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CATALOG_PRODUCTS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_ATTRIBUTES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_ATTRIBUTES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SUPPLIERS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_SUPPLIERS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_EMAIL_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_EMAIL_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_NEWSLETTER_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_NEWSLETTER_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. } else {
  2. $chosen = [];
  3. foreach ($_POST['chosen'] as $id) {
  4. if (is_numeric($id) && !\in_array($id, $chosen)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $chosen[] = $id;
  6. }
  7. }
  8. $ids = array_map(function ($k) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. } else {
  3. $chosen = [];
  4. foreach ($_POST['chosen'] as $id) {
  5. if (is_numeric($id) && !\in_array($id, $chosen)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $chosen[] = $id;
  7. }
  8. }
  9. $ids = array_map(function ($k) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $allowed = array_map(function ($v) {
  2. return basename($v, '.php');
  3. }, glob(CLICSHOPPING::BASE_DIR . 'Apps/Communication/Newsletter/Module/ClicShoppingAdmin/Newsletter/*.php'));
  4. if (!\in_array($newsletter_module, $allowed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_Newsletter->getDef('error_newsletter_module_not_exists'), 'danger');
  6. $newsletter_error = true;
  7. }
  8. if ($newsletters_accept_file == 'on') {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $allowed = array_map(function ($v) {
  2. return basename($v, '.php');
  3. }, glob(CLICSHOPPING::BASE_DIR . 'Apps/Communication/Newsletter/Module/ClicShoppingAdmin/Newsletter/*.php'));
  4. if (!\in_array($newsletter_module, $allowed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_Newsletter->getDef('error_newsletter_module_not_exists'), 'danger');
  6. $newsletter_error = true;
  7. }
  8. if ($newsletters_accept_file == 'on') {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PAGE_MANAGER_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PAGE_MANAGER_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ADMINISTRATORS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ADMINISTRATORS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. foreach ($Qips as $allowedIp) {
  2. $ip = $allowedIp['ip'];
  3. if ($ip === '127.0.0.1' || $ip === 'localhost') {
  4. if (in_array($clientIp, ['127.0.0.1', '::1'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. self::logSecurityEvent('Localhost access granted', [
  6. 'api_id' => $api_id,
  7. 'client_ip' => $clientIp
  8. ]);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. */
  2. public static function isLocalEnvironment(): bool
  3. {
  4. $ip = HTTP::getIpAddress();
  5. if (in_array($ip, ['127.0.0.1', '::1'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. return true;
  7. }
  8. $serverName = $_SERVER['SERVER_NAME'] ?? '';
  9. $host = $_SERVER['HTTP_HOST'] ?? '';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. $method = strtoupper($_SERVER["REQUEST_METHOD"]);
  3. $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'];
  4. if (!in_array($method, $allowedMethods)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. throw new Exception("Invalid HTTP method: " . $method);
  6. }
  7. return $method;
  8. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_API_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_API_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CACHE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CACHE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. foreach ($models as $model) {
  2. $modelId = $model['id'];
  3. $provider = $model['provider'] ?? 'openai'; // Default to openai if missing
  4. // Validate provider name
  5. if (!in_array($provider, $validProviders)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if (defined('CLICSHOPPING_APP_CHATGPT_CH_DEBUG') && CLICSHOPPING_APP_CHATGPT_CH_DEBUG === 'True') {
  7. error_log("WARNING: Invalid provider '$provider' for model '$modelId'. Using 'openai' as default.");
  8. }
  9. $provider = 'openai';
  10. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. 'open-mistral-nemo',
  2. 'open-codestral-mamba',
  3. 'mistral-moderation-latest'
  4. ];
  5. if (empty($model) || !in_array($model, $valid_models)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $model = 'mistral-large-latest';
  7. }
  8. $config = new MistralAIChat();
  9. $config->apiKey = $api_key;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. // Validate type is one of expected values
  3. if (isset($response['type'])) {
  4. $validTypes = ['analytics', 'semantic', 'web_search', 'hybrid', 'error', 'clarification'];
  5. if (!in_array($response['type'], $validTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $warnings[] = "Unexpected type value: {$response['type']}";
  7. }
  8. }
  9. return [
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if ($productData && !$productData['in_stock']) {
  2. $messages[] = [
  3. 'type' => 'error',
  4. 'code' => 'out_of_stock',
  5. 'text' => 'Produit ' . $productData['title'] . ' temporairement indisponible',
  6. 'path' => '$.line_items[' . array_search($lineItem, $lineItems) . ']'
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. ];
  8. }
  9. }
  10. // Add promotional messages
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CHATGPT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CHATGPT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. exit;
  2. }
  3. // Validate feedback_type
  4. $validTypes = ['positive', 'negative', 'correction'];
  5. if (!in_array($input['feedback_type'], $validTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. echo json_encode([
  7. 'success' => false,
  8. 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
  9. ]);
  10. exit;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_COUNTRIES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_COUNTRIES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CURRENCY_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CURRENCY_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_LANGUES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_LANGUES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. foreach (glob(CLICSHOPPING::getConfig('dir_root', 'ClicShoppingAdmin') . 'Core/languages/*', GLOB_ONLYDIR) as $dir) {
  3. $code = basename($dir);
  4. if (array_search($code, array_column($directories, 'id')) === false) {
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $directories[] = ['id' => $code,
  6. 'text' => $code
  7. ];
  8. }
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. foreach (glob(CLICSHOPPING::getConfig('dir_root', 'ClicShoppingAdmin') . 'Core/languages/*', GLOB_ONLYDIR) as $dir) {
  3. $code = basename($dir);
  4. if (array_search($code, array_column($directories, 'id')) === false) {
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $directories[] = ['id' => $code,
  6. 'text' => $code
  7. ];
  8. }
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_MODULES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_MODULES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $module->install();
  2. $modules_installed = explode(';', \constant($module_key));
  3. if (!\in_array($class . $file_extension, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  4. $modules_installed[] = $class . $file_extension;
  5. }
  6. Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
  7. ['configuration_key' => $module_key]
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $module->remove();
  2. $modules_installed = explode(';', \constant($module_key));
  3. if (\in_array($class . $file_extension, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  4. unset($modules_installed[array_search($class . $file_extension, $modules_installed)]);
  5. }
  6. Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
  7. ['configuration_key' => $module_key]
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $module->remove();
  2. $modules_installed = explode(';', \constant($module_key));
  3. if (\in_array($class . $file_extension, $modules_installed)) {
  4. unset($modules_installed[array_search($class . $file_extension, $modules_installed)]);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. }
  6. Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)],
  7. ['configuration_key' => $module_key]
  8. );
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if ($dir = @dir($module_directory)) {
  2. while ($file = $dir->read()) {
  3. if (!is_dir($module_directory . $file)) {
  4. if (substr($file, strrpos($file, '.')) == $file_extension) {
  5. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  6. if (!\in_array($file, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $directory_array[] = $file;
  8. }
  9. } else {
  10. if (\in_array($file, $modules_installed)) {
  11. $directory_array[] = $file;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  2. if (!\in_array($file, $modules_installed)) {
  3. $directory_array[] = $file;
  4. }
  5. } else {
  6. if (\in_array($file, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $directory_array[] = $file;
  8. } else {
  9. $new_modules_counter++;
  10. }
  11. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. if (isset($appModuleType)) {
  3. foreach (Apps::getModules($appModuleType) as $k => $v) {
  4. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  5. if (!\in_array($k, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $directory_array[] = $k;
  7. }
  8. } else {
  9. if (\in_array($k, $modules_installed)) {
  10. $directory_array[] = $k;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  2. if (!\in_array($k, $modules_installed)) {
  3. $directory_array[] = $k;
  4. }
  5. } else {
  6. if (\in_array($k, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $directory_array[] = $k;
  8. } else {
  9. $new_modules_counter++;
  10. }
  11. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if ($dir = @dir($module_directory)) {
  2. while ($file = $dir->read()) {
  3. if (!is_dir($module_directory . $file)) {
  4. if (substr($file, strrpos($file, '.')) === $file_extension) {
  5. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  6. if (!\in_array($file, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $directory_array[] = $file;
  8. }
  9. } else {
  10. if (\in_array($file, $modules_installed)) {
  11. $directory_array[] = $file;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  2. if (!\in_array($file, $modules_installed)) {
  3. $directory_array[] = $file;
  4. }
  5. } else {
  6. if (\in_array($file, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $directory_array[] = $file;
  8. } else {
  9. $new_modules_counter++;
  10. }
  11. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. if (isset($appModuleType)) {
  3. foreach (Apps::getModules($appModuleType) as $k => $v) {
  4. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  5. if (!\in_array($k, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $directory_array[] = $k;
  7. }
  8. } else {
  9. if (\in_array($k, $modules_installed)) {
  10. $directory_array[] = $k;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (isset($_GET['list']) && ($_GET['list'] == 'new')) {
  2. if (!\in_array($k, $modules_installed)) {
  3. $directory_array[] = $k;
  4. }
  5. } else {
  6. if (\in_array($k, $modules_installed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $directory_array[] = $k;
  8. } else {
  9. $new_modules_counter++;
  10. }
  11. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. <tr>
  2. <td><?php echo $module->title; ?></td>
  3. <td class="text-start"><?php echo $module->group; ?></td>
  4. <td class="text-end">
  5. <?php
  6. if (\in_array($module->code . $file_extension, $modules_installed) && is_numeric($module->sort_order)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. echo $module->sort_order;
  8. }
  9. ?>
  10. </td>
  11. <td class="text-center">
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $Qcheck = $CLICSHOPPING_Db->get('configuration', 'configuration_value', ['configuration_key' => 'TEMPLATE_BLOCK_GROUPS']);
  2. if ($Qcheck->fetch() !== false) {
  3. $tbgroups_array = explode(';', $Qcheck->value('configuration_value'));
  4. if (!\in_array($module_type, $tbgroups_array)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $tbgroups_array[] = $module_type;
  6. sort($tbgroups_array);
  7. $CLICSHOPPING_Db->save('configuration', [
  8. 'configuration_value' => implode(';', $tbgroups_array),
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ORDERS_STATUS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ORDERS_STATUS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ORDERS_STATUS_INVOICE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ORDERS_STATUS_INVOICE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PROUCTS_LENGTH_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PROUCTS_LENGTH_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_QUANTITY_UNIT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_QUANTITY_UNIT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SETTINGS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_SETTINGS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_TAX_CLASS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_TAX_CLASS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_TAX_GEO_ZONES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_TAX_GEO_ZONES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_TAX_RATES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_TAX_RATES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_TEMPLATE_EMAIL_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_TEMPLATE_EMAIL_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_WEIGHT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_WEIGHT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ZONES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ZONES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CUSTOMERS_INFO_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_INFO_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CUSTOMERS_GDPR_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_GDPR_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CUSTOMERS_GROUPS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_GROUPS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
  2. if (str_contains($include_modules[$i]['class'], '\\')) {
  3. Registry::set('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
  4. $module = Registry::get('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']));
  5. if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $payments_unallowed))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $content .= '<div class="row">';
  7. $content .= '<div class="col-md-5">';
  8. $content .= '<div class="form-group row">';
  9. $content .= '<div class="col-md-12">';
  10. $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
  2. if (str_contains($include_modules[$i]['class'], '\\')) {
  3. Registry::set('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
  4. $module = Registry::get('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']));
  5. if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $shipping_unallowed))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $content .= '<div class="col-md-12">';
  7. $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
  8. $content .= '<span class="col-md-3">' . $module->title . '</span>';
  9. $content .= '</div>';
  10. } elseif ($cInfo->customers_group_id != 0 && !\in_array($module->code, $shipping_unallowed)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (($cInfo->customers_group_id != 0) && (\in_array($module->code, $shipping_unallowed))) {
  2. $content .= '<div class="col-md-12">';
  3. $content .= '<span class="col-md-1"><i class="bi-check text-success"></i></span>';
  4. $content .= '<span class="col-md-3">' . $module->title . '</span>';
  5. $content .= '</div>';
  6. } elseif ($cInfo->customers_group_id != 0 && !\in_array($module->code, $shipping_unallowed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $content .= '<div class="col-md-12">';
  8. $content .= '<span class="col-md-1"><i class="bi-check text-danger"></i></span>';
  9. $content .= '<span class="col-md-3">' . $module->title . '</span>';
  10. $content .= '</div>';
  11. } elseif ($cInfo->customers_group_id == 0) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. <div class="form-group row">
  2. <div class="col-md-12">
  3. <ul class="list-group-slider list-group-flush">
  4. <li class="list-group-item-slider">
  5. <label class="switch">
  6. <?php echo HTML::checkboxField('payment_unallowed[' . $i . ']', $module->code, (\in_array($module->code, $payments_unallowed)) ? true : false, 'class="success"'); ?>
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. <span class="slider"></span>
  8. </label>
  9. </li>
  10. <span class="text-slider"><?php echo $module->title; ?></span>
  11. </ul>
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. <div class="form-group row">
  2. <div class="col-md-12">
  3. <ul class="list-group-slider list-group-flush">
  4. <li class="list-group-item-slider">
  5. <label class="switch">
  6. <?php echo HTML::checkboxField('shipping_unallowed[' . $i . ']', $module->code, (\in_array($module->code, $shipping_unallowed)) ? true : false, 'class="success"'); ?>
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. <span class="slider"></span>
  8. </label>
  9. </li>
  10. <span class="text-slider"><?php echo $module->title; ?></span>
  11. </ul>
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CUSTOMERS_MEMBERS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CUSTOMERS_MEMBERS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_REVIEWS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_REVIEWS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_BANNER_MANAGER_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_BANNER_MANAGER_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_FAVORITES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_FAVORITES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_FEATURED_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_FEATURED_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_PRODUCT_RECOMMENDATIONS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_PRODUCT_RECOMMENDATIONS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SEO_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_SEO_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_SPECIALS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_SPECIALS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_ORDER_TOTAL_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. {
  2. if (!$this->isEnabled()) {
  3. return $this->skip($this->app->getDef('skip_module_disabled'));
  4. }
  5. if (!in_array($invoice_status, [self::STATUS_INVOICE, self::STATUS_CANCEL, self::STATUS_CREDIT_NOTE])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. return $this->skip($this->app->getDef('skip_status_not_actionable') . ' (' . $invoice_status . ')');
  7. }
  8. if ($this->isAlreadySent($order_id)) {
  9. return $this->skip($this->app->getDef('skip_already_sent') . ' #' . $order_id);
  • gyakutsuki

    not included
  1. $msg = $this->app->getDef('error_oauth2_failed') . ' #' . $order_id;
  2. $this->writeOrderHistory($order_id, '[ERROR] ' . $msg, false);
  3. return $this->failure($msg);
  4. }
  5. $doc_type = in_array($invoice_status, [self::STATUS_CANCEL, self::STATUS_CREDIT_NOTE]) ? self::TYPE_CREDIT_NOTE : self::TYPE_INVOICE;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $payload = $this->buildPayload($order_id, $customer, $info, $products, $totals, $doc_type);
  7. if ($payload === null) {
  8. $msg = $this->app->getDef('error_payload_failed');
  9. $this->writeOrderHistory($order_id, '[ERROR] ' . $msg, false);
  • gyakutsuki

    not included
  1. // Extract totals from the order totals array
  2. $ht = $tva = $ttc = 0.0;
  3. foreach ($totals as $t) {
  4. $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
  5. $c = $t['class'] ?? '';
  6. if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
  8. if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
  9. }
  10. // Fallback: compute HT from product lines if ot_subtotal not found
  • gyakutsuki

    not included
  1. $ht = $tva = $ttc = 0.0;
  2. foreach ($totals as $t) {
  3. $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
  4. $c = $t['class'] ?? '';
  5. if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
  6. if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
  8. }
  9. // Fallback: compute HT from product lines if ot_subtotal not found
  10. if ($ht == 0.0) {
  • gyakutsuki

    not included
  1. foreach ($totals as $t) {
  2. $val = (float)str_replace(',', '.', preg_replace('/[^0-9.,\-]/', '', strip_tags($t['text'] ?? '0')));
  3. $c = $t['class'] ?? '';
  4. if (in_array($c, ['ot_subtotal', 'ST'])) $ht = $val;
  5. if (in_array($c, ['ot_tax', 'TX'])) $tva = $val;
  6. if (in_array($c, ['ot_total', 'TO'])) $ttc = $val;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. // Fallback: compute HT from product lines if ot_subtotal not found
  9. if ($ht == 0.0) {
  10. foreach ($products as $p) {
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ORDERS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ORDERS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if ((int)$check['orders_status_invoice'] === $new_invoice_status) {
  2. return;
  3. }
  4. // Only process actionable statuses
  5. if (!in_array($new_invoice_status, [
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. EInvoiceService::STATUS_INVOICE,
  7. EInvoiceService::STATUS_CANCEL,
  8. EInvoiceService::STATUS_CREDIT_NOTE,
  9. ])) {
  10. return;
  • gyakutsuki

    not included
  1. ?>
  2. <span class="badge bg-success"><?php echo $CLICSHOPPING_Orders->getDef('badge_transmitted'); ?></span>
  3. &nbsp;<span class="text-success small"><?php echo $CLICSHOPPING_Orders->getDef('text_transmitted_notice'); ?></span>
  4. <?php
  5. } elseif (!in_array($current_invoice_status_id, [EInvoiceService::STATUS_INVOICE, EInvoiceService::STATUS_CANCEL, EInvoiceService::STATUS_CREDIT_NOTE])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. ?>
  7. <span class="badge bg-warning text-dark"><?php echo $CLICSHOPPING_Orders->getDef('badge_pending'); ?></span>
  8. &nbsp;<span class="text-muted small"><?php echo $CLICSHOPPING_Orders->getDef('text_pending_notice'); ?></span>
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_PRODUCTS_RETURN_ORDERS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_PRODUCTS_RETURN_ORDERS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_PAYMENT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_PAYMENT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_PAYMENT_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_PAYMENT_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_STATS_PRODUCTS_NOTIFICATION_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_STATS_PRODUCTS_NOTIFICATION_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_SHIPPING_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_SHIPPING_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_SHIPPING_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_SHIPPING_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $CLICSHOPPING_Language = Registry::get('Language');
  2. $module = HTML::sanitize(str_replace(' ', '', $module));
  3. if (defined('MODULE_ACTION_RECORDER_INSTALLED') && !is_null(MODULE_ACTION_RECORDER_INSTALLED)) {
  4. if (!is_null($module) && in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. if (!class_exists($module)) {
  6. if (is_file($CLICSHOPPING_Template->getModuleDirectory() . '/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)))) {
  7. $CLICSHOPPING_Language->loadDefinitions('modules/action_recorder/' . $module);
  8. include($CLICSHOPPING_Template->getModuleDirectory() . '/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)));
  9. } else {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ACTIONS_RECORDER_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ACTIONS_RECORDER_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $modules_array[] = $Qmodules->value('module');
  2. }
  3. $expired_entries = 0;
  4. if (isset($_GET['module']) && \in_array($_GET['module'], $modules_array)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $get_module_class = $CLICSHOPPING_ActionsRecorderClass->getClassModule($_GET['module']);
  6. if (\is_object($get_module_class)) {
  7. $expired_entries += $get_module_class->expireEntries();
  8. } else {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. echo HTML::form('search', $CLICSHOPPING_ActionsRecorder->link('ActionsRecorder'), 'post', '', ['session_id' => true]);
  2. echo HTML::selectField('module', $modules_list_array, null, 'onchange="this.form.submit();"');
  3. ?>
  4. </span>
  5. <span class="col-md-1 text-end">
  6. <?php echo HTML::button($CLICSHOPPING_ActionsRecorder->getDef('button_reset'), null, $CLICSHOPPING_ActionsRecorder->link('ActionsRecorder&Expire' . (isset($_POST['module']) && \in_array($_POST['module'], $modules_array) ? '&module=' . $_POST['module'] : '')), 'danger'); ?>
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. </span>
  8. </div>
  9. </form>
  10. </div>
  11. </div>
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. </thead>
  2. <tbody>
  3. <?php
  4. $filter = [];
  5. if (isset($_POST['module']) && \in_array($_POST['module'], $modules_array)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $filter[] = 'module = :module';
  7. }
  8. if (isset($_POST['search']) && !empty($_POST['search'])) {
  9. $filter[] = 'identifier like :identifier';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $sql_query .= ' order by date_added desc limit :page_set_offset, :page_set_max_results';
  2. $Qactions = $CLICSHOPPING_ActionsRecorder->db->prepare($sql_query);
  3. if (!empty($filter)) {
  4. if (isset($_POST['module']) && \in_array($_POST['module'], $modules_array)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $Qactions->bindValue(':module', $_POST['module']);
  6. }
  7. if (isset($_POST['search']) && !empty($_POST['search'])) {
  8. $Qactions->bindValue(':identifier', '%' . $_POST['search'] . '%');
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. <div class="row">
  2. <div class="col-md-12">
  3. <div
  4. class="col-md-6 float-start pagenumber hidden-xs TextDisplayNumberOfLink"><?php echo $Qactions->getPageSetLabel($CLICSHOPPING_ActionsRecorder->getDef('text_display_number_of_link')); ?></div>
  5. <div
  6. class="float-end text-end"> <?php echo $Qactions->getPageSetLinks((isset($_POST['module']) && \in_array($_POST['module'], $modules_array) && \is_object($GLOBALS[$_POST['module']]) ? 'module=' . $_POST['module'] : null) . '&' . (isset($_POST['search']) && !empty($_POST['search']) ? 'search=' . $_POST['search'] : null)); ?></div>
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. </div>
  8. </div>
  9. </div>
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_ADMINISTRATOR_MENU_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_ADMINISTRATOR_MENU_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (isset($this->Id) && ($this->Id != $this->moveToCategoryID)) {
  2. $new_parent_id = $this->moveToCategoryID;
  3. $path = explode('_', AdministratorMenu::getGeneratedAdministratorMenuPathIds($new_parent_id));
  4. if (\in_array($this->Id, $path)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $CLICSHOPPING_MessageStack->add($this->app->getDef('error_cannot_move_directory_to_parent'), 'error');
  6. $this->app->redirect('AdministratorMenu&cPath=' . (int)$this->cPath . '&cID=' . (int)$this->Id);
  7. } else {
  8. $this->app->db->save('administrator_menu', [
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_APPS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_APPS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_BACKUP_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_BACKUP_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $dir = dir($backup_directory);
  2. $contents = [];
  3. while ($file = $dir->read()) {
  4. if (!is_dir($backup_directory . $file) && \in_array(substr($file, -3), array('zip', 'sql', '.gz'))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $contents[] = $file;
  6. }
  7. }
  8. sort($contents);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_CRONJOB_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_CRONJOB_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_DATA_BASE_TABLES_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_DATA_BASE_TABLES_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. ['id' => 'utf8',
  2. 'text' => $CLICSHOPPING_DataBaseTables->getDef('action_utf8_conversion')
  3. ]);
  4. if (isset($_POST['action'])) {
  5. if (\in_array($_POST['action'], array('check', 'analyze', 'optimize', 'repair', 'utf8'))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (isset($_POST['id']) && \is_array($_POST['id']) && !empty($_POST['id'])) {
  7. $tables = Database::getDtTables();
  8. foreach ($_POST['id'] as $key => $value) {
  9. if (!\in_array($value, $tables)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (\in_array($_POST['action'], array('check', 'analyze', 'optimize', 'repair', 'utf8'))) {
  2. if (isset($_POST['id']) && \is_array($_POST['id']) && !empty($_POST['id'])) {
  3. $tables = Database::getDtTables();
  4. foreach ($_POST['id'] as $key => $value) {
  5. if (!\in_array($value, $tables)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. unset($_POST['id'][$key]);
  7. }
  8. }
  9. if (!empty($_POST['id'])) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. while ($Qaction->fetch()) {
  2. $table_data[] = [
  3. ($table != $current_table) ? HTML::outputProtected($table) : '',
  4. $Qaction->valueProtected('Msg_type'),
  5. $Qaction->valueProtected('Msg_text'),
  6. ($table != $current_table) ? HTML::checkboxField('id[]', $table, isset($_POST['id']) && \in_array($table, $_POST['id'])) : ''
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. ];
  8. $current_table = $table;
  9. }
  10. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_DEFINE_LANGUAGE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_DEFINE_LANGUAGE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory_selected));
  2. foreach ($file_array as $filename => $current) {
  3. $fileInfo = pathinfo($current->getFileName());
  4. if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $found[] = $current->getFileName();
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($filename_selected));
  2. foreach ($file_array as $filename => $current) {
  3. $fileInfo = pathinfo($current->getFileName());
  4. if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $found[] = $current->getFileName();
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $file_array = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($template_directory));
  2. foreach ($file_array as $filename => $current) {
  3. $fileInfo = pathinfo($current->getFileName());
  4. if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $found[] = $current->getFileName();
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. /* if empty error is produced : Fatal error: Uncaught exception 'RuntimeException'*/
  2. foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($template_directory)) as $filename => $current) {
  3. $fileInfo = pathinfo($current->getFileName());
  4. if (array_key_exists('extension', $fileInfo) && \in_array($fileInfo['extension'], $fileTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $found[] = $current->getFileName();
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_EDIT_DESIGN_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_EDIT_DESIGN_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_EDIT_LOG_ERROR_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_EDIT_LOG_ERROR_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. * @param array $checks An array of check results, each with a 'status' key.
  2. * @return string The overall status: 'error', 'warning', or 'healthy'.
  3. */
  4. private function determineOverallStatus(array $checks): string
  5. {
  6. if (in_array('error', array_column($checks, 'status'))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. return 'error';
  8. }
  9. if (in_array('warning', array_column($checks, 'status'))) {
  10. return 'warning';
  11. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. private function determineOverallStatus(array $checks): string
  2. {
  3. if (in_array('error', array_column($checks, 'status'))) {
  4. return 'error';
  5. }
  6. if (in_array('warning', array_column($checks, 'status'))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. return 'warning';
  8. }
  9. return 'healthy';
  10. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. foreach ($Qips as $allowedIp) {
  2. $ip = $allowedIp['ip'];
  3. if ($ip === '127.0.0.1' || $ip === 'localhost') {
  4. if (in_array($clientIp, ['127.0.0.1', '::1'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. self::logSecurityEvent('Localhost access granted', [
  6. 'mcp_id' => $mcp_id,
  7. 'client_ip' => $clientIp
  8. ]);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. */
  2. public static function isLocalEnvironment(): bool
  3. {
  4. $ip = HTTP::getIpAddress();
  5. if (in_array($ip, ['127.0.0.1', '::1'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. return true;
  7. }
  8. $serverName = $_SERVER['SERVER_NAME'] ?? '';
  9. $host = $_SERVER['HTTP_HOST'] ?? '';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. $method = strtoupper($_SERVER["REQUEST_METHOD"]);
  3. $allowedMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'];
  4. if (!in_array($method, $allowedMethods)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. throw new Exception("Invalid HTTP method: " . $method);
  6. }
  7. return $method;
  8. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_MCP_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_MCP_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. /**
  2. * Valide une clé d'API pour un niveau d'accès donné
  3. */
  4. public function validateMcpKey(string $mcpKey, string $accessLevel): bool {
  5. if (!in_array($accessLevel, $this->accessLevels)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. return false;
  7. }
  8. if (!isset($this->validMcpKeys[$accessLevel])) {
  9. return false;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (!isset($this->validMcpKeys[$accessLevel])) {
  2. return false;
  3. }
  4. return in_array($mcpKey, $this->validMcpKeys[$accessLevel]);
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  5. }
  6. /**
  7. * Valide les headers de sécurité requis
  8. */
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. 'ssl_enabled' => $sslEnabled,
  2. 'origin' => $origin
  3. ];
  4. // Add to allowed origins list
  5. if (!in_array($origin, $this->allowedOrigins)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $this->allowedOrigins[] = $origin;
  7. }
  8. }
  9. // Fallback to localhost if no configurations found
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. /**
  2. * Check if an origin is allowed
  3. */
  4. public function isOriginAllowed(string $origin): bool {
  5. return in_array($origin, $this->allowedOrigins);
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }
  7. /**
  8. * Valide une clé d'API pour un niveau d'accès donné
  9. */
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. /**
  2. * Valide une clé d'API pour un niveau d'accès donné
  3. */
  4. public function validateMcpKey(string $mcpKey, string $accessLevel): bool {
  5. if (!in_array($accessLevel, $this->accessLevels)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. return false;
  7. }
  8. if (!isset($this->validMcpKeys[$accessLevel])) {
  9. return false;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (!isset($this->validMcpKeys[$accessLevel])) {
  2. return false;
  3. }
  4. return in_array($mcpKey, $this->validMcpKeys[$accessLevel]);
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. }
  6. /**
  7. * Valide les headers de sécurité requis
  8. */
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_MODULES_HOOKS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_MODULES_HOOKS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SEC_DIR_PERMISSIONS_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_SEC_DIR_PERMISSIONS_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if ($handle = opendir($path)) {
  2. while (false !== ($filename = readdir($handle))) {
  3. if (!\in_array($filename, $exclude_array)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  4. $file = ['name' => $path . $filename,
  5. 'is_dir' => is_dir($path . $filename),
  6. 'writable' => FileSystem::isWritable($path . $filename)
  7. ];
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. <th
  2. scope="row"><?php echo substr($file['name'], \strlen(CLICSHOPPING::getConfig('dir_root', 'Shop'))); ?></th>
  3. <td
  4. class="text-center"><?php echo $file['writable'] === true ? '<i class="bi-check text-success"></i>' : '<i class="bi bi-x text-danger"></i>'; ?></td>
  5. <td
  6. class="text-center"><?php echo(\in_array(substr($file['name'], \strlen(CLICSHOPPING::getConfig('dir_root', 'Shop'))), $whitelist_array) ? '<i class="bi-check text-success"></i>' : '<i class="bi bi-x text-danger"></i>'); ?></td>
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. </tr>
  8. <?php
  9. }
  10. }
  11. ?>
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SECURITY_CHECK_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_SECURITY_CHECK_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. <?php
  2. foreach ($modules as $module) {
  3. $secCheck = $GLOBALS[$module['class']];
  4. if (!\in_array($secCheck->type, $types)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $secCheck->type = 'info';
  6. }
  7. $output = '';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_SERVICE_APP_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_SERVICE_APP_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_UPGRADE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_UPGRADE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function uninstall()
  2. {
  3. parent::uninstall();
  4. $installed = explode(';', MODULE_MODULES_WHOS_ONLINE_INSTALLED);
  5. $installed_pos = array_search($this->app->vendor . '\\' . $this->app->code . '\\' . $this->code, $installed);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($installed_pos !== false) {
  7. unset($installed[$installed_pos]);
  8. $this->app->saveCfgParam('MODULE_MODULES_WHOS_ONLINE_INSTALLED', implode(';', $installed));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $default_module = $m;
  2. break;
  3. }
  4. }
  5. $this->page->data['current_module'] = (isset($_GET['module']) && \in_array($_GET['module'], $modules)) ? $_GET['module'] : $default_module;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. continue;
  2. }
  3. $fullClass = self::NAMESPACE_PREFIX . $fileInfo->getBasename('.php');
  4. if (class_exists($fullClass) && in_array(ActionToolsInterface::class, class_implements($fullClass))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  5. try {
  6. /** @var ActionToolsInterface $toolInstance */
  7. $toolInstance = new $fullClass();
  8. $toolName = $toolInstance->getName();
  9. $this->tools[$toolName] = $fullClass;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $details_string = preg_replace('/comment\(.+\)$/', '', $details_string);
  2. $details = array_filter(explode(' ', $details_string), fn($v) => $v !== null && $v !== '');
  3. $details = array_values($details);
  4. }
  5. $is_binary = array_search('binary', $details);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (is_int($is_binary)) {
  7. array_splice($details, $is_binary, 1);
  8. $schema['col'][$field_name]['binary'] = true;
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (is_int($is_binary)) {
  2. array_splice($details, $is_binary, 1);
  3. $schema['col'][$field_name]['binary'] = true;
  4. }
  5. $is_unsigned = array_search('unsigned', $details);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (is_int($is_unsigned)) {
  7. array_splice($details, $is_unsigned, 1);
  8. $schema['col'][$field_name]['unsigned'] = true;
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (is_int($is_unsigned)) {
  2. array_splice($details, $is_unsigned, 1);
  3. $schema['col'][$field_name]['unsigned'] = true;
  4. }
  5. $is_not_null = array_search('not_null', $details);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (is_int($is_not_null)) {
  7. array_splice($details, $is_not_null, 1);
  8. $schema['col'][$field_name]['not_null'] = true;
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (is_int($is_not_null)) {
  2. array_splice($details, $is_not_null, 1);
  3. $schema['col'][$field_name]['not_null'] = true;
  4. }
  5. $is_auto_increment = array_search('auto_increment', $details);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (preg_match('/on_update\(([^)]+)\)/', $details_string, $on_update_match)) {
  7. $schema['col'][$field_name]['on_update'] = $on_update_match[1];
  8. $details_string = preg_replace('/on_update\([^)]+\)/', '', $details_string);
  9. $details = array_values(array_filter(explode(' ', $details_string)));
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $this->result = $this->cache_data;
  2. } else {
  3. $fetch_argument = $args[0] ?? null;
  4. $ctor_args = $args[1] ?? [];
  5. if (in_array($fetch_style, [PDO::FETCH_COLUMN])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $this->result = parent::fetchAll($fetch_style, $fetch_argument);
  7. } elseif (in_array($fetch_style, [PDO::FETCH_CLASS, PDO::FETCH_FUNC])) {
  8. $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
  9. } else {
  10. $this->result = parent::fetchAll($fetch_style);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $fetch_argument = $args[0] ?? null;
  2. $ctor_args = $args[1] ?? [];
  3. if (in_array($fetch_style, [PDO::FETCH_COLUMN])) {
  4. $this->result = parent::fetchAll($fetch_style, $fetch_argument);
  5. } elseif (in_array($fetch_style, [PDO::FETCH_CLASS, PDO::FETCH_FUNC])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
  7. } else {
  8. $this->result = parent::fetchAll($fetch_style);
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. */
  2. public function setExcludeEntries(?array $entries)
  3. {
  4. if (is_array($entries)) {
  5. foreach ($entries as $value) {
  6. if (!in_array($value, $this->exclude_entries)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $this->exclude_entries[] = $value;
  8. }
  9. }
  10. } elseif (is_string($entries)) {
  11. if (!in_array($entries, $this->exclude_entries)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (!in_array($value, $this->exclude_entries)) {
  2. $this->exclude_entries[] = $value;
  3. }
  4. }
  5. } elseif (is_string($entries)) {
  6. if (!in_array($entries, $this->exclude_entries)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. $this->exclude_entries[] = $entries;
  8. }
  9. }
  10. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $this->listing = array();
  2. }
  3. if ($dir = @dir($directory)) {
  4. while (($entry = $dir->read()) !== false) {
  5. if (!in_array($entry, $this->exclude_entries)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (($this->include_files === true) && is_file($dir->path . DIRECTORY_SEPARATOR . $entry)) {
  7. if (empty($this->check_extension) || in_array(mb_strtolower(substr($entry, strrpos($entry, '.') + 1)), $this->check_extension)) {
  8. if ($this->adddirectory_to_filename === true) {
  9. if ($dir->path !== $this->directory) {
  10. $entry = substr($dir->path, strlen($this->directory) + 1) . DIRECTORY_SEPARATOR . $entry;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if ($dir = @dir($directory)) {
  2. while (($entry = $dir->read()) !== false) {
  3. if (!in_array($entry, $this->exclude_entries)) {
  4. if (($this->include_files === true) && is_file($dir->path . DIRECTORY_SEPARATOR . $entry)) {
  5. if (empty($this->check_extension) || in_array(mb_strtolower(substr($entry, strrpos($entry, '.') + 1)), $this->check_extension)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($this->adddirectory_to_filename === true) {
  7. if ($dir->path !== $this->directory) {
  8. $entry = substr($dir->path, strlen($this->directory) + 1) . DIRECTORY_SEPARATOR . $entry;
  9. }
  10. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. * @param string $type The type of the module to check for.
  2. * @return bool Returns true if the module exists, false otherwise.
  3. */
  4. final public function hasModule(string $module, string $type): bool
  5. {
  6. return isset($this->modules[$type]) && in_array($module, $this->modules[$type]);
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. }
  8. /**
  9. * Sets the app information by reflecting the current class and loading data
  10. * from a metafile. Assigns the app's code, vendor, title, version, and modules
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $field .= ' id="' . static::output(substr($parameters, $offset + 4, strpos($parameters, '"', $offset + 4) - ($offset + 4))) . '_' . $counter . '"';
  2. }
  3. $field .= ' value="' . static::output($selection_value) . '"';
  4. if (isset($default) && (($default === true) || (!is_array($default) && ((string)$default == (string)$selection_value)) || (is_array($default) && in_array($selection_value, $default)))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $field .= ' checked="checked"';
  6. }
  7. if (!empty($parameters)) {
  8. $field .= ' ' . $parameters;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (!isset($params['type'])) {
  2. $params['type'] = 'submit';
  3. }
  4. if (!in_array($params['type'], $types)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $params['type'] = 'submit';
  6. }
  7. if (($params['type'] == 'submit') && isset($link)) {
  8. $params['type'] = 'button';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (($params['type'] == 'submit') && isset($link)) {
  2. $params['type'] = 'button';
  3. }
  4. if (isset($style) && !in_array($style, $styles)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. unset($style);
  6. }
  7. if (isset($size) && !in_array($size, $size_button)) {
  8. unset($size);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (isset($style) && !in_array($style, $styles)) {
  2. unset($style);
  3. }
  4. if (isset($size) && !in_array($size, $size_button)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. unset($size);
  6. }
  7. $button = '';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (!isset($data['cafile'])) {
  2. $data['cafile'] = CLICSHOPPING::BASE_DIR . 'External/cacert.pem';
  3. }
  4. if (isset($data['format']) && !in_array($data['format'], ['json'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. trigger_error('HttpRequest::getResponse(): Unknown "format": ' . $data['format']);
  6. unset($data['format']);
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. ];
  2. $domain = strtolower(substr(strrchr($email, "@"), 1));
  3. if (in_array($domain, $temp_domains)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  4. return true;
  5. }
  6. }
  7. return false;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $stack = [
  2. 'text' => $message,
  3. 'type' => $type
  4. ];
  5. if (!$this->exists($group) || !in_array($stack, $this->data[$group])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $this->data[$group][] = $stack;
  7. }
  8. }
  9. /**
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. }
  3. if (!empty($this->_upload)) {
  4. if (!empty($this->_extensions)) {
  5. if (!in_array(mb_strtolower(substr($this->_upload['name'], strrpos($this->_upload['name'], '.') + 1)), $this->_extensions)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $CLICSHOPPING_MessageStack->add(CLICSHOPPING::getDef('error_filetype_not_allowed') . implode(', ', $this->_extensions), 'warning');
  7. return false;
  8. }
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. public function isInstalled()
  2. {
  3. $module = HTML::sanitize(str_replace(' ', '', $this->_module));
  4. if (defined('MODULE_ACTION_RECORDER_INSTALLED') && !is_null(MODULE_ACTION_RECORDER_INSTALLED)) {
  5. if (!is_null($module) && \in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (!class_exists($module)) {
  7. if (is_file(CLICSHOPPING::getConfig('dir_root', 'Shop') . 'Core/modules/action_recorder/' . $module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)))) {
  8. $this->lang->loadDefinitions('Shop/Module/ActionRecorder/' . $module);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
  2. foreach ($contents as $item) {
  3. $fileInfo = pathinfo($item);
  4. if (array_key_exists('extension', $fileInfo) && \in_array($fileInfo['extension'], $fileTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $found[] = $item;
  6. }
  7. }
  8. if ($found) { // Check the $found array is not empty
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. sort($select_array);
  2. $values_array = explode(';', $values);
  3. $output = '';
  4. foreach ($select_array as $file) {
  5. $output .= HTML::checkboxField('ht_datepicker_jquery_file[]', $file, \in_array($file, $values_array)) . '&nbsp;' . HTML::outputProtected($file) . '<br />';
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. if (!empty($output)) {
  8. $output = '<br />' . substr($output, 0, -6);
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $Qproducts->bindInt(':language_id', (int)$CLICSHOPPING_Language->getId());
  2. $Qproducts->execute();
  3. while ($Qproducts->fetch()) {
  4. if (MODE_B2B_B2C == 'True') {
  5. if (!in_array($Qproducts->valueInt('products_id'), $exclude)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $Qprice = $CLICSHOPPING_Db->prepare('select customers_group_price,
  7. customers_group_id
  8. from :table_products_groups
  9. where products_id = :products_id
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $price_string = '';
  2. $sde = 0;
  3. //while(list($sdek,$sdev)=each($all_groups)){
  4. foreach ($all_groups as $sdek => $sdev) {
  5. if (!in_array($Qproducts->valueInt('products_id') . ":" . (int)$sdek, $exclude)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($sde)
  7. $price_string .= ' - ';
  8. $price_string .= $sdev . ' : ' . $CLICSHOPPING_Currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek] : $Qproducts->valueDecimal('products_price'));
  9. $sde = 1;
  10. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. // Ajouter VISITOR_NAME . ': ' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) pour permettre d'afficher le prix des clients qui ne font pas partie d'un groupe B2B(
  2. $select_string .= '<option value="' . $Qproducts->valueInt('products_id') . '">' . HTML::outputProtected($Qproducts->value('products_name')) . ' (' . CLICSHOPPING::getDef('visitor_name') . ': ' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) . ' - ' . $price_string . ')</option>';
  3. }
  4. } else {
  5. if (!in_array($Qproducts->valueInt('products_id'), $exclude)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $select_string .= '<option value="' . $Qproducts->valueInt('products_id') . '">' . HTML::outputProtected($Qproducts->value('products_name')) . ' (' . $CLICSHOPPING_Currencies->format($Qproducts->valueDecimal('products_price')) . ')</option>';
  7. }
  8. }
  9. // ####### END #######
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. {
  2. if (is_dir($source) === true) {
  3. $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::CHILD_FIRST);
  4. foreach ($files as $file) {
  5. if (in_array($file->getBasename(), array('.', '..')) !== true) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ($file->isDir() === true) {
  7. rmdir($file->getPathName());
  8. } elseif (($file->isFile() === true) || ($file->isLink() === true)) {
  9. unlink($file->getPathname());
  10. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $fileTypes = ['php']; // Create an array of file types
  2. $found = []; // Traverse the folder, and add filename to $found array if type matches
  3. foreach ($contents as $item) {
  4. $fileInfo = pathinfo($item);
  5. if (array_key_exists('extension', $fileInfo) && in_array($fileInfo['extension'], $fileTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $found[] = $item;
  7. }
  8. }
  9. if ($found) { // Check the $found array is not empty
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $QpaymentsNotAllowed->execute();
  2. $payments_not_allowed = $QpaymentsNotAllowed->fetch();
  3. $payments_unallowed = explode(",", $payments_not_allowed['group_payment_unallowed']);
  4. $clearance = (in_array($pay_check, $payments_unallowed)) ? true : false;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. } elseif ($CLICSHOPPING_Customer->isLoggedOn()) {
  6. $clearance = true;
  7. } else {
  8. $clearance = false;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $Qpayments->execute();
  2. $payments_not_allowed = $Qpayments->fetch();
  3. $payments_unallowed = explode(",", $payments_not_allowed['group_payment_unallowed']);
  4. $clearance = (!in_array($pay_check, $payments_unallowed)) ? true : false;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. return $clearance;
  6. }
  7. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $QshippingNotAllowed->execute();
  2. $shipping_not_allowed = $QshippingNotAllowed->fetch();
  3. $shipping_unallowed = explode(",", $shipping_not_allowed['group_shipping_unallowed']);
  4. $shipping_clearance = (in_array($shipping_check, $shipping_unallowed)) ? true : false;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. } elseif ($CLICSHOPPING_Customer->isLoggedOn()) {
  6. $shipping_clearance = true;
  7. } else {
  8. $shipping_clearance = false;
  9. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $shipping_not_allowed = $Qshipping->fetch();
  2. if (!empty($shipping_not_allowed['group_payment_unallowed'])) {
  3. $shipping_unallowed = explode(',', $shipping_not_allowed['group_payment_unallowed']);
  4. $shipping_clearance = (!in_array($shipping_check, $shipping_unallowed)) ? true : false;
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. } else {
  6. $shipping_clearance = false;
  7. }
  8. return $shipping_clearance;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $string = '';
  2. if (is_array($array) && !empty($array)) {
  3. foreach ($array as $key => $value) {
  4. if (!in_array($key, $exclude)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $string .= $key . '=' . $value . '&';
  6. }
  7. }
  8. $string = substr($string, 0, -1);
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $Qglobal->execute();
  2. $global = $Qglobal->fetch();
  3. if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] === $_SESSION['sessiontoken'])) {
  4. if (isset($_POST['product_global']) && is_numeric($_POST['product_global']) && in_array($_POST['product_global'], ['0', '1'])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $product_global = (int)$_POST['product_global'];
  6. } else {
  7. $product_global = 0;
  8. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. } elseif (count($products) > 0) {
  2. $products_parsed = [];
  3. foreach ($products as $value) {
  4. if (is_numeric($value) && !in_array($value, $products_parsed)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $products_parsed[] = $value;
  6. }
  7. }
  8. if (count($products_parsed) > 0) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (defined('MODULE_PAYMENT_INSTALLED') && !is_null(MODULE_PAYMENT_INSTALLED)) {
  2. $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
  3. $include_modules = [];
  4. if ((!is_null($module)) && (in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules, true) || in_array($module, $this->modules))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $this->selected_module = $module;
  6. if (str_contains($module, '\\')) {
  7. $class = Apps::getModuleClass($module, 'Payment');
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (($this->getCountPaymentModules() == 1) && (!isset($_SESSION['payment']) || ($_SESSION['payment'] != $include_modules[0]['class']))) {
  2. $_SESSION['payment'] = $include_modules[0]['class'];
  3. }
  4. if ((!is_null($module)) && (in_array($module . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules, true) || in_array($module, $this->modules))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. if (str_contains($module, '\\')) {
  6. $CLICSHOPPING_PM = Registry::get('Payment_' . str_replace('\\', '_', $module));
  7. if (isset($CLICSHOPPING_PM->form_action_url)) {
  8. /**
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $code = $vendor . '\\' . $app . '\\' . $module;
  2. }
  3. }
  4. if (isset($code) && (in_array($code . '.' . substr(CLICSHOPPING::getIndex(), (strrpos(CLICSHOPPING::getIndex(), '.') + 1)), $this->modules) || in_array($code, $this->modules))) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. if (str_contains($code, '\\')) {
  6. $class = Apps::getModuleClass($code, 'Shipping');
  7. $include_modules[] = [
  8. 'class' => $code,
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. include($this->_directoryIncludes . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
  2. }
  3. }
  4. // exclude $modules_boxe and search if the modules exist
  5. if (is_numeric(array_search($group, $this->getReadModulesDefaultDirectories())) && $group != $modules_boxes) {
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $result = array_search($group, $this->getReadModulesDefaultDirectories());
  7. if (!is_null($result)) {
  8. if (is_file($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
  9. include($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. }
  3. // exclude $modules_boxe and search if the modules exist
  4. if (is_numeric(array_search($group, $this->getReadModulesDefaultDirectories())) && $group != $modules_boxes) {
  5. $result = array_search($group, $this->getReadModulesDefaultDirectories());
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (!is_null($result)) {
  7. if (is_file($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
  8. include($this->getPathDirectoryTemplateThema() . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php');
  9. } elseif (is_file($this->getDefaultTemplateDirectory() . DIRECTORY_SEPARATOR . $this->_directoryModules . $group . DIRECTORY_SEPARATOR . $class . '.php')) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. $currentParent = $newParentId;
  2. $visitedCategories = [];
  3. // Traverse up the parent chain to check for circular reference
  4. while ($currentParent !== 0) {
  5. if (in_array($currentParent, $visitedCategories)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. return true; // Already visited, indicates circular reference
  7. }
  8. if ($currentParent === $categoryId) {
  9. return true; // Found the original category in the parent chain
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. // Validate numeric fields
  2. if (isset($data['suppliers_country_id']) && !is_numeric($data['suppliers_country_id'])) {
  3. $errors[] = 'Country ID must be numeric';
  4. }
  5. if (isset($data['suppliers_status']) && !in_array($data['suppliers_status'], [0, 1])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. $errors[] = 'Supplier status must be 0 or 1';
  7. }
  8. if (isset($data['languages_id']) && !is_numeric($data['languages_id'])) {
  9. $errors[] = 'Language ID must be numeric';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. while ($file = $dir->read()) {
  2. if (!is_dir($backup_directory . $file)) {
  3. $ext = substr($file, strrpos($file, '.') + 1);
  4. if (in_array($ext, array('zip', 'sql', 'gz')) && !isset($contents[$ext])) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. $contents[$ext] = $file;
  6. if ($ext != 'sql') { // zip and gz (binaries) are prioritized over sql (plain text)
  7. break;
  8. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. } else {
  3. $products_attributes_image = '';
  4. }
  5. $checked = \is_array($selected_attributes) && \in_array($value['id'], $selected_attributes) ? ' checked' : '';
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $chk_id = 'chk_' . $QproductsOptionsName->valueInt('products_options_id') . '_' . $value['id'];
  7. $products_options_content_display .= '<div class="col-md-12">';
  8. $products_options_content_display .= '<span class="ModuleProductsInfoOptionsPullDownMenu">';
  9. $products_options_content_display .= '<div class="custom-control custom-checkbox">';
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. foreach ($dir_content as $key => $content) {
  2. $path = $root_dir . DIRECTORY_SEPARATOR . $content;
  3. if (is_file($path) && is_readable($path)) {
  4. // skip ignored files
  5. if (!\in_array($content, $ignore_files)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if (preg_match($ignore_regex, $content) == 0) {
  7. $content_chunks = explode(".", $content);
  8. $ext = $content_chunks[\count($content_chunks) - 1];
  9. // only include files with desired extensions
  10. if (\in_array($ext, $allow_extensions)) {
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. if (!\in_array($content, $ignore_files)) {
  2. if (preg_match($ignore_regex, $content) == 0) {
  3. $content_chunks = explode(".", $content);
  4. $ext = $content_chunks[\count($content_chunks) - 1];
  5. // only include files with desired extensions
  6. if (\in_array($ext, $allow_extensions)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. // save file name with path
  8. $all_data[] = $path;
  9. }
  10. }
  11. }
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  1. }
  2. }
  3. } // if content is a directory and readable, add path and name
  4. elseif (is_dir($path) && is_readable($path)) {
  5. // skip any ignored dirs
  6. if (!\in_array($content, $ignore_dirs)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. // recursive callback to open new directory
  8. $all_data = get_files($path, $all_data);
  9. }
  10. }
  11. } // end foreach
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included

Your project should not contain PHP files defining multiple classes 2

More information: https://insight.symfony.com/what-we-analyse/php.file_contains_more_than_one_class

This file contains 4 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.
Last edited by ClicShopping
  • McpException (defined at line 19)
  • McpConnectionException (defined at line 28)
  • McpProtocolException (defined at line 37)
  • McpConfigurationException (defined at line 46)
  • gyakutsuki

    Ignored on Mon, 29 Sep 2025 19:19:44 GMT
This file contains 2 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.
Time to fix: about 4 hours
Read doc Open Issue Permalink Copy Prompt
Last edited by ClicShopping
  • he_header_multi_template (defined at line 16)
  • explodeCategoryTree (defined at line 238)
  • gyakutsuki

    Ignored on Thu, 18 Sep 2025 15:32:21 GMT

Your project should use dedicated PHP string functions 262

More information: https://insight.symfony.com/what-we-analyse/php.use_string_function

  1. // Track statistics
  2. if (strlen($columnComment) > 0) {
  3. $backup_stats['columns_with_comments']++;
  4. }
  5. if (strpos(strtolower($columnType), 'vector') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $backup_stats['vector_columns']++;
  7. }
  8. $schema .= ' ' . $Qfields->value('COLUMN_NAME') . ' ' . $columnType;
  • gyakutsuki

    not included
  1. // Check if column type is VECTOR (cannot have empty string default)
  2. $is_vector_type = preg_match('/^vector/i', $columnType);
  3. // Check if default value is already quoted (starts and ends with single quote)
  4. $is_already_quoted = (strlen($default_value) >= 2 &&
  5. substr($default_value, 0, 1) === "'" &&
    Consider replacing substr() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. substr($default_value, -1) === "'");
  7. // Skip empty string defaults for numeric types (invalid SQL)
  8. if ($is_numeric_type && $default_value === '') {
  9. // Don't add default clause - let MySQL use its default behavior
  • gyakutsuki

    not included
  1. $is_vector_type = preg_match('/^vector/i', $columnType);
  2. // Check if default value is already quoted (starts and ends with single quote)
  3. $is_already_quoted = (strlen($default_value) >= 2 &&
  4. substr($default_value, 0, 1) === "'" &&
  5. substr($default_value, -1) === "'");
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. // Skip empty string defaults for numeric types (invalid SQL)
  7. if ($is_numeric_type && $default_value === '') {
  8. // Don't add default clause - let MySQL use its default behavior
  9. } elseif ($is_datetime_type && $default_value === '') {
  • gyakutsuki

    not included
  1. $schema .= 'NULL, ';
  2. } elseif (!\is_null($Qrows->value($i))) {
  3. $row = $Qrows->value($i);
  4. // Check if this is a VECTOR column
  5. if (isset($columnTypes[$i]) && strpos(strtolower($columnTypes[$i]), 'vector') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. // VECTOR data is already in the correct format from MariaDB
  7. // Just escape it properly
  8. $row = addslashes($row);
  9. } else {
  10. $row = addslashes($row);
  • gyakutsuki

    not included
  1. glob($oldCacheDir . 'Rag_Embedding_*.cache'),
  2. glob($oldCacheDir . 'embedding_*.cache')
  3. );
  4. // Exclude embedding_search files
  5. $oldFiles = array_filter($oldFiles, function($file) {
  6. return strpos(basename($file), 'embedding_search_') !== 0;
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. });
  8. $filesBefore += count($oldFiles);
  9. // Delete old embedding cache files
  10. foreach ($oldFiles as $file) {
  • gyakutsuki

    not included
  1. $oldFiles = array_merge(
  2. glob($oldCacheDir . 'Rag_Embedding_*.cache'),
  3. glob($oldCacheDir . 'embedding_*.cache')
  4. );
  5. $oldFiles = array_filter($oldFiles, function($file) {
  6. return strpos(basename($file), 'embedding_search_') !== 0;
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. });
  8. $filesAfter += count($oldFiles);
  9. }
  10. $results['embedding'] = $filesBefore - $filesAfter;
  • gyakutsuki

    not included
  1. $oldFiles = array_merge(
  2. glob($oldCacheDir . 'Rag_Embedding_*.cache'),
  3. glob($oldCacheDir . 'embedding_*.cache')
  4. );
  5. $oldFiles = array_filter($oldFiles, function($file) {
  6. return strpos(basename($file), 'embedding_search_') !== 0;
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. });
  8. $filesBefore += count($oldFiles);
  9. foreach ($oldFiles as $file) {
  10. @unlink($file);
  11. }
  • gyakutsuki

    not included
  1. $oldFilesAfter = array_merge(
  2. glob($oldCacheDir . 'Rag_Embedding_*.cache'),
  3. glob($oldCacheDir . 'embedding_*.cache')
  4. );
  5. $oldFilesAfter = array_filter($oldFilesAfter, function($file) {
  6. return strpos(basename($file), 'embedding_search_') !== 0;
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. });
  8. $filesAfter += count($oldFilesAfter);
  9. }
  10. $results['embeddings'] = $filesBefore - $filesAfter;
  • gyakutsuki

    not included
  1. ['grow', 'shrink']
  2. ];
  3. // Check if goals contain contradictory terms
  4. foreach ($contradictions as $pair) {
  5. $has1in1 = strpos($goal1, $pair[0]) !== false;
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $has2in1 = strpos($goal1, $pair[1]) !== false;
  7. $has1in2 = strpos($goal2, $pair[0]) !== false;
  8. $has2in2 = strpos($goal2, $pair[1]) !== false;
  9. // If obj1 has first term and obj2 has second term (or vice versa)
  • gyakutsuki

    not included
  1. ];
  2. // Check if goals contain contradictory terms
  3. foreach ($contradictions as $pair) {
  4. $has1in1 = strpos($goal1, $pair[0]) !== false;
  5. $has2in1 = strpos($goal1, $pair[1]) !== false;
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $has1in2 = strpos($goal2, $pair[0]) !== false;
  7. $has2in2 = strpos($goal2, $pair[1]) !== false;
  8. // If obj1 has first term and obj2 has second term (or vice versa)
  9. if (($has1in1 && $has2in2) || ($has2in1 && $has1in2)) {
  • gyakutsuki

    not included
  1. // Check if goals contain contradictory terms
  2. foreach ($contradictions as $pair) {
  3. $has1in1 = strpos($goal1, $pair[0]) !== false;
  4. $has2in1 = strpos($goal1, $pair[1]) !== false;
  5. $has1in2 = strpos($goal2, $pair[0]) !== false;
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $has2in2 = strpos($goal2, $pair[1]) !== false;
  7. // If obj1 has first term and obj2 has second term (or vice versa)
  8. if (($has1in1 && $has2in2) || ($has2in1 && $has1in2)) {
  9. // Check if they're operating on similar subjects
  • gyakutsuki

    not included
  1. // Check if goals contain contradictory terms
  2. foreach ($contradictions as $pair) {
  3. $has1in1 = strpos($goal1, $pair[0]) !== false;
  4. $has2in1 = strpos($goal1, $pair[1]) !== false;
  5. $has1in2 = strpos($goal2, $pair[0]) !== false;
  6. $has2in2 = strpos($goal2, $pair[1]) !== false;
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. // If obj1 has first term and obj2 has second term (or vice versa)
  8. if (($has1in1 && $has2in2) || ($has2in1 && $has1in2)) {
  9. // Check if they're operating on similar subjects
  10. $similarity = $this->calculateSimilarity($obj1, $obj2);
  • gyakutsuki

    not included
  1. 'database', 'table', 'index', 'query', 'cache', 'memory',
  2. 'file', 'log', 'configuration', 'setting', 'registry'
  3. ];
  4. foreach ($resourceKeywords as $keyword) {
  5. if (strpos($text, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $resources[] = $keyword;
  7. }
  8. }
  9. return array_unique($resources);
  • gyakutsuki

    not included
  1. 'optimize' => ['optimize', 'improve', 'enhance', 'tune']
  2. ];
  3. foreach ($operationPatterns as $operation => $keywords) {
  4. foreach ($keywords as $keyword) {
  5. if (strpos($text, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $operations[] = $operation;
  7. break;
  8. }
  9. }
  10. }
  • gyakutsuki

    not included
  1. * @param string $ip The IP address to check
  2. * @param string $range The CIDR range (e.g., '
  3. */
  4. public static function ipInRange(string $ip, string $range): bool
  5. {
  6. if (strpos($range, '/') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  7. return $ip === $range;
  8. }
  9. list($subnet, $bits) = explode('/', $range);
  10. $ip = ip2long($ip);
  • gyakutsuki

    not included
  1. {
  2. $params = [];
  3. // Model-specific parameter mapping
  4. // GPT-4o-mini, GPT-4.1 series, GPT-5 series use max_completion_tokens
  5. if (strpos($model, 'gpt-4.1-mini') === 0 ||
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. strpos($model, 'gpt-4.1') === 0 ||
  7. strpos($model, 'gpt-5') === 0) {
  8. $params['max_completion_tokens'] = $maxtoken;
  9. } else {
  10. // Default for GPT-4o, Anthropic, Mistral, LM Studio, and other models
  • gyakutsuki

    not included
  1. $params = [];
  2. // Model-specific parameter mapping
  3. // GPT-4o-mini, GPT-4.1 series, GPT-5 series use max_completion_tokens
  4. if (strpos($model, 'gpt-4.1-mini') === 0 ||
  5. strpos($model, 'gpt-4.1') === 0 ||
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. strpos($model, 'gpt-5') === 0) {
  7. $params['max_completion_tokens'] = $maxtoken;
  8. } else {
  9. // Default for GPT-4o, Anthropic, Mistral, LM Studio, and other models
  10. $params['max_tokens'] = $maxtoken;
  • gyakutsuki

    not included
  1. // Model-specific parameter mapping
  2. // GPT-4o-mini, GPT-4.1 series, GPT-5 series use max_completion_tokens
  3. if (strpos($model, 'gpt-4.1-mini') === 0 ||
  4. strpos($model, 'gpt-4.1') === 0 ||
  5. strpos($model, 'gpt-5') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $params['max_completion_tokens'] = $maxtoken;
  7. } else {
  8. // Default for GPT-4o, Anthropic, Mistral, LM Studio, and other models
  9. $params['max_tokens'] = $maxtoken;
  10. }
  • gyakutsuki

    not included
  1. $models = self::getGptModel();
  2. foreach ($models as $modelInfo) {
  3. if ($modelInfo['id'] === $model) {
  4. // Check if this is a GPT-5 series model (uses reasoning API)
  5. if (strpos($modelInfo['id'], 'gpt-5') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. return false;
  9. }
  • gyakutsuki

    not included
  1. return false;
  2. }
  3. }
  4. // Model not found in list - check by prefix as fallback
  5. return strpos($model, 'gpt-5') === 0;
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. }
  7. /**
  8. * Get model context length limit
  9. *
  • gyakutsuki

    not included
  1. $module_key = $CLICSHOPPING_CfgModule->get($set, 'key');
  2. $appModuleType = $CLICSHOPPING_ModulesAdmin->getSwitchModules($module_type);
  3. if (strpos($_GET['module'], '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  4. $class = Apps::getModuleClass($_GET['module'], $appModuleType);
  5. if (class_exists($class)) {
  6. $file_extension = '';
  7. $module = new $class();
  • gyakutsuki

    not included
  1. $modules_payment = explode(';', $Qconfiguration_payment->value('configuration_value'));
  2. $include_modules = [];
  3. foreach ($modules_payment as $value) {
  4. if (strpos($value, '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  5. $class = Apps::getModuleClass($value, 'Payment');
  6. $include_modules[] = ['class' => $value,
  7. 'file' => $class
  8. ];
  • gyakutsuki

    not included
  1. ];
  2. }
  3. }
  4. for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
  5. if (strpos($include_modules[$i]['class'], '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. Registry::set('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
  7. $module = Registry::get('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']));
  8. ?>
  9. <div class="row">
  10. <div class="col-md-12">
  • gyakutsuki

    not included
  1. $modules_shipping = explode(';', $Qconfiguration_shipping->value('configuration_value'));
  2. $include_modules = [];
  3. foreach ($modules_shipping as $value) {
  4. if (strpos($value, '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  5. $class = Apps::getModuleClass($value, 'Shipping');
  6. $include_modules[] = ['class' => $value,
  7. 'file' => $class
  8. ];
  • gyakutsuki

    not included
  1. ];
  2. }
  3. }
  4. for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
  5. if (strpos($include_modules[$i]['class'], '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. Registry::set('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
  7. $module = Registry::get('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']));
  8. ?>
  9. <div class="row">
  10. <div class="col-md-12">
  • gyakutsuki

    not included
  1. while ($Qcols->fetch()) {
  2. if ($Qcols->hasValue('Collation') && !\is_null($Qcols->value('Collation'))) {
  3. // Skip VECTOR columns - they are binary data and cannot be converted to UTF8
  4. $columnType = strtolower($Qcols->value('Type'));
  5. if (strpos($columnType, 'vector') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. continue;
  7. }
  8. if ($_POST['from_charset'] == 'auto') {
  9. $old_charset = substr($Qcols->value('Collation'), 0, strpos($Qcols->value('Collation'), '_'));
  • gyakutsuki

    not included
  1. * @param string $ip The IP address to check
  2. * @param string $range The CIDR range (e.g., '192.168.1.0/24')
  3. */
  4. public static function ipInRange(string $ip, string $range): bool
  5. {
  6. if (strpos($range, '/') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  7. return $ip === $range;
  8. }
  9. list($subnet, $bits) = explode('/', $range);
  10. $ip = ip2long($ip);
  • gyakutsuki

    not included
  1. // Process special vector fields
  2. $vector_fields = [];
  3. foreach ($data as $field => $value) {
  4. // Check if the field is meant to be a vector and starts with 'vec_'
  5. if (substr($field, 0, 4) === 'vec_') {
    Consider replacing substr() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. $actual_field = substr($field, 4); // Get the actual field name without 'vec_' prefix
  7. $vector_fields[$actual_field] = $value; // Store the vector value
  8. unset($data[$field]); // Remove the special prefixed field
  9. }
  10. }
  • gyakutsuki

    not included
  1. if (!preg_match('/^[a-zA-Z0-9_]*$/', $prefix)) {
  2. throw new \InvalidArgumentException('Invalid table prefix');
  3. }
  4. // Ajout d'un underscore terminal si le préfixe est non vide et ne se termine pas déjà par un underscore
  5. if ($prefix !== '' && substr($prefix, -1) !== '_') {
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by ClicShopping
  6. $prefix .= '_';
  7. }
  8. // Substitution sûre des tokens
  9. return preg_replace_callback('/:table_([a-zA-Z0-9_]+)/', function ($matches) use ($prefix) {
  • gyakutsuki

    not included
  1. if ($path === '' || $path === '.' . $separator) {
  2. return $systemroot;
  3. }
  4. if (substr($path, 0, 3) === '..' . $separator) {
    Consider replacing substr() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  5. $path = $systemroot . $path;
  6. }
  7. // Normalize path
  8. $path = rtrim($path, $separator) . $separator;
  • gyakutsuki

    not included
  1. // Normalize path
  2. $path = rtrim($path, $separator) . $separator;
  3. // Absolute path
  4. if ($path[0] === $separator || strpos($path, $systemroot) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  5. return $path;
  6. }
  7. // Relative path from 'Here'
  8. if (substr($path, 0, 2) === '.' . $separator || $path[0] !== '.') {
  • gyakutsuki

    not included
  1. if ($path[0] === $separator || strpos($path, $systemroot) === 0) {
  2. return $path;
  3. }
  4. // Relative path from 'Here'
  5. if (substr($path, 0, 2) === '.' . $separator || $path[0] !== '.') {
    Consider replacing substr() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. $arrn = preg_split('/\\' . $separator . '/', $path, -1, PREG_SPLIT_NO_EMPTY);
  7. if ($arrn[0] !== '.') {
  8. array_unshift($arrn, '.');
  9. }
  10. $arrn[0] = rtrim($base, $separator);
  • gyakutsuki

    not included
  1. // Clear from Memcached (note: Memcached doesn't support key pattern matching easily)
  2. // We'll rely on TTL expiration for Memcached
  3. // Clear from file cache
  4. foreach ($this->promptCache as $key => $data) {
  5. if (strpos($key, $prefix) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. unset($this->promptCache[$key]);
  7. $cleared++;
  8. }
  9. }
  • gyakutsuki

    not included
  1. // iterate through all keys. We'll rely on TTL expiration for Memcached.
  2. // For production use, consider using Redis for better invalidation support.
  3. // Invalidate from file cache
  4. foreach ($this->promptCache as $key => $data) {
  5. if (strpos($key, self::CACHE_TYPE_SQL) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. if (isset($data['tables_used']) && in_array($cleanTableName, $data['tables_used'], true)) {
  7. unset($this->promptCache[$key]);
  8. $invalidated++;
  9. }
  10. }
  • gyakutsuki

    not included
  1. }
  2. }
  3. // Invalidate from file cache
  4. foreach ($this->promptCache as $key => $data) {
  5. if (strpos($key, self::CACHE_TYPE_SQL) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. if (isset($data['tables_used'])) {
  7. $intersection = array_intersect($cleanTableNames, $data['tables_used']);
  8. if (!empty($intersection)) {
  9. unset($this->promptCache[$key]);
  10. $invalidated++;
  • gyakutsuki

    not included
  1. {
  2. // Remove backticks and quotes
  3. $tableName = str_replace(['`', '"', "'"], '', $tableName);
  4. // Remove database prefix (e.g., database.table -> table)
  5. if (strpos($tableName, '.') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $parts = explode('.', $tableName);
  7. $tableName = end($parts);
  8. }
  9. // Remove alias (take only the first word)
  • gyakutsuki

    not included
  1. if ($output !== null) {
  2. // Envoi des Headers HTTP
  3. header('Content-Type: ' . $mimeType);
  4. // Détermine l'extension et encode si c'est du JSON
  5. if (strpos($mimeType, 'json') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. // S'assurer que la sortie est un tableau/objet avant d'encoder
  7. if (is_array($output) || is_object($output)) {
  8. $output = json_encode($output, JSON_PRETTY_PRINT);
  9. }
  10. }
  • gyakutsuki

    not included
  1. // Simple contradiction check
  2. $s1Lower = strtolower($statement1);
  3. $s2Lower = strtolower($statement2);
  4. // Check for negation patterns
  5. if (strpos($s1Lower, 'not') !== false && strpos($s2Lower, 'not') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. return false;
  9. }
  • gyakutsuki

    not included
  1. private function evaluateSqlEfficiency(string $sql, array $tablesUsed, string $queryType): float
  2. {
  3. $score = 0.7; // Base score
  4. // Check for SELECT * (inefficient)
  5. if (strpos($sql, 'SELECT *') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $score -= 0.2;
  7. }
  8. // Check for proper indexing hints
  9. if ($this->hasProperIndexing($sql, $tablesUsed)) {
  • gyakutsuki

    not included
  1. $queryWords = explode(' ', strtolower($userQuery));
  2. $sqlLower = strtolower($sql);
  3. $matches = 0;
  4. foreach ($queryWords as $word) {
  5. if (strlen($word) > 3 && strpos($sqlLower, $word) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $matches++;
  7. }
  8. }
  9. return $matches > 0;
  • gyakutsuki

    not included
  1. }
  2. private function hasProperIndexing(string $sql, array $tables): bool
  3. {
  4. // Check for WHERE clauses that might benefit from indexes
  5. return strpos($sql, 'WHERE') !== false;
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. }
  7. private function hasUnnecessaryJoins(string $sql): bool
  8. {
  9. // Count JOINs - more than 5 might be excessive
  • gyakutsuki

    not included
  1. }
  2. private function isWellFormatted(string $sql): bool
  3. {
  4. // Check for basic formatting (line breaks, indentation)
  5. return strpos($sql, "\n") !== false || strpos($sql, "\r") !== false;
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. }
  7. private function hasMeaningfulAliases(string $sql): bool
  8. {
  9. // Check for table aliases that are more than single letters
  • gyakutsuki

    not included
  1. return false;
  2. }
  3. private function hasComments(string $sql): bool
  4. {
  5. return strpos($sql, '--') !== false || strpos($sql, '/*') !== false;
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. }
  7. private function hasConsistentData(array $results): bool
  8. {
  9. if (empty($results)) return true;
  • gyakutsuki

    not included
  1. // Fallback to simple keyword detection if detector fails
  2. $ambiguousTerms = ['best', 'good', 'recent', 'popular', 'top', 'better', 'worse'];
  3. $queryLower = strtolower($query);
  4. foreach ($ambiguousTerms as $term) {
  5. if (strpos($queryLower, $term) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. return false;
  • gyakutsuki

    not included
  1. 'HAVING',
  2. 'DISTINCT'
  3. ];
  4. foreach ($slowPatterns as $pattern) {
  5. if (strpos($sqlUpper, $pattern) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. // Check for multiple JOINs
  • gyakutsuki

    not included
  1. * @return string Escaped value
  2. */
  3. private function escapeCsvValue(string $value): string
  4. {
  5. // Escape quotes and wrap in quotes if contains comma, quote, or newline
  6. if (strpos($value, ',') !== false || strpos($value, '"') !== false || strpos($value, "\n") !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return '"' . str_replace('"', '""', $value) . '"';
  8. }
  9. return $value;
  10. }
  • gyakutsuki

    not included
  1. // Propose permission level always requires approval for write actions
  2. if ($permissionLevel === self::PERMISSION_PROPOSE) {
  3. $writeActions = ['create', 'update', 'delete', 'modify', 'propose'];
  4. foreach ($writeActions as $writeAction) {
  5. if (strpos($action, $writeAction) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. }
  • gyakutsuki

    not included
  1. $text = strtolower("$reason $comment");
  2. foreach ($keywords as $type => $words) {
  3. foreach ($words as $word) {
  4. if (strpos($text, $word) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. return $type;
  6. }
  7. }
  8. }
  • gyakutsuki

    not included
  1. // 🔍 DEBUG: Log prompt loading verification
  2. if ($this->debug) {
  3. error_log("[INFO : ANALYSE] [UnifiedQueryAnalyzer] Prompt Loading Verification:");
  4. error_log(" Prompt length: " . strlen($prompt) . " characters");
  5. error_log(" Prompt preview (first 200 chars): " . substr($prompt, 0, 200) . "...");
  6. error_log(" Query in prompt: " . (strpos($prompt, $query) !== false ? 'YES' : 'NO'));
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. }
  8. // Single GPT call for everything
  9. // Use Gpt::getGptResponse() instead of non-existent complete() method
  • gyakutsuki

    not included
  1. if ($this->debug) {
  2. error_log("UnifiedQueryAnalyzer: Built prompt from language file sections");
  3. error_log("UnifiedQueryAnalyzer: Query to analyze: {$query}");
  4. error_log("UnifiedQueryAnalyzer: Total prompt length: " . strlen($prompt) . " characters");
  5. error_log("UnifiedQueryAnalyzer: Prompt contains query: " . (strpos($prompt, $query) !== false ? 'YES' : 'NO'));
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. }
  7. return $prompt;
  8. }
  • gyakutsuki

    not included
  1. */
  2. private function categorizeError(string $errorMessage): string
  3. {
  4. $message = strtolower($errorMessage);
  5. if (strpos($message, 'database') !== false || strpos($message, 'sql') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return 'database';
  7. }
  8. if (strpos($message, 'timeout') !== false || strpos($message, 'time out') !== false) {
  9. return 'timeout';
  10. }
  • gyakutsuki

    not included
  1. $message = strtolower($errorMessage);
  2. if (strpos($message, 'database') !== false || strpos($message, 'sql') !== false) {
  3. return 'database';
  4. }
  5. if (strpos($message, 'timeout') !== false || strpos($message, 'time out') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return 'timeout';
  7. }
  8. if (strpos($message, 'memory') !== false) {
  9. return 'memory';
  10. }
  • gyakutsuki

    not included
  1. return 'database';
  2. }
  3. if (strpos($message, 'timeout') !== false || strpos($message, 'time out') !== false) {
  4. return 'timeout';
  5. }
  6. if (strpos($message, 'memory') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return 'memory';
  8. }
  9. if (strpos($message, 'validation') !== false || strpos($message, 'invalid') !== false) {
  10. return 'validation';
  11. }
  • gyakutsuki

    not included
  1. return 'timeout';
  2. }
  3. if (strpos($message, 'memory') !== false) {
  4. return 'memory';
  5. }
  6. if (strpos($message, 'validation') !== false || strpos($message, 'invalid') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return 'validation';
  8. }
  9. if (strpos($message, 'classification') !== false || strpos($message, 'intent') !== false) {
  10. return 'classification';
  11. }
  • gyakutsuki

    not included
  1. return 'memory';
  2. }
  3. if (strpos($message, 'validation') !== false || strpos($message, 'invalid') !== false) {
  4. return 'validation';
  5. }
  6. if (strpos($message, 'classification') !== false || strpos($message, 'intent') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return 'classification';
  8. }
  9. if (strpos($message, 'api') !== false || strpos($message, 'gpt') !== false) {
  10. return 'api';
  11. }
  • gyakutsuki

    not included
  1. return 'validation';
  2. }
  3. if (strpos($message, 'classification') !== false || strpos($message, 'intent') !== false) {
  4. return 'classification';
  5. }
  6. if (strpos($message, 'api') !== false || strpos($message, 'gpt') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return 'api';
  8. }
  9. return 'unknown';
  10. }
  • gyakutsuki

    not included
  1. // If it's an array, search for the response
  2. if (is_array($executionResult)) {
  3. if (isset($executionResult['text_response']) && !empty($executionResult['text_response'])) {
  4. // Check if text_response is NOT the JSON fallback
  5. if (strpos($executionResult['text_response'], 'Résultat:') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $executionResult['text_response'];
  7. }
  8. }
  9. if (isset($executionResult['response']) && !empty($executionResult['response'])) {
  • gyakutsuki

    not included
  1. }
  2. }
  3. // Priority 4: Check if rawResult has 'text_response' field (but not if it's the JSON fallback)
  4. if (isset($rawResult['text_response']) && !empty($rawResult['text_response'])) {
  5. if (strpos($rawResult['text_response'], 'Résultat:') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $rawResult['text_response'];
  7. }
  8. }
  9. // Priority 5: Use finalResponse if available (but not if it's the JSON fallback)
  • gyakutsuki

    not included
  1. return $rawResult['text_response'];
  2. }
  3. }
  4. // Priority 5: Use finalResponse if available (but not if it's the JSON fallback)
  5. if (!empty($finalResponse) && strpos($finalResponse, 'Résultat:') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $finalResponse;
  7. }
  8. return '';
  9. }
  • gyakutsuki

    not included
  1. // Check if source type is valid (case-insensitive, partial match)
  2. $sourceType = strtolower($sourceAttr['source_type']);
  3. $isValidSource = false;
  4. foreach ($validSourceTypes as $validType) {
  5. if (strpos($sourceType, strtolower($validType)) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $isValidSource = true;
  7. break;
  8. }
  9. }
  • gyakutsuki

    not included
  1. 'as an ai',
  2. 'i\'m an ai'
  3. ];
  4. foreach ($genericPhrases as $phrase) {
  5. if (strpos($response, $phrase) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $validationErrors[] = "Response contains generic LLM phrase indicating lack of knowledge";
  7. return false;
  8. }
  9. }
  • gyakutsuki

    not included
  1. $table = $matches[1];
  2. }
  3. // Ajouter le préfixe si nécessaire
  4. $prefix = CLICSHOPPING::getConfig('db_prefix');
  5. if (!empty($prefix) && strpos($table, $prefix) !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $table = $prefix . $table;
  7. }
  8. return trim($table, '`"\'');
  9. }
  • gyakutsuki

    not included
  1. private function determineSuggestedActionForSqlError(string $errorMessage, string $temporalPeriod): string
  2. {
  3. $errorLower = strtolower($errorMessage);
  4. // Check for common error patterns
  5. if (strpos($errorLower, 'column') !== false || strpos($errorLower, 'field') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return "The database may not have the required columns for {$temporalPeriod} aggregation. Try a different time period or check your data schema.";
  7. }
  8. if (strpos($errorLower, 'table') !== false) {
  9. return "The required table for {$temporalPeriod} aggregation may not exist. Verify your database structure.";
  • gyakutsuki

    not included
  1. // Check for common error patterns
  2. if (strpos($errorLower, 'column') !== false || strpos($errorLower, 'field') !== false) {
  3. return "The database may not have the required columns for {$temporalPeriod} aggregation. Try a different time period or check your data schema.";
  4. }
  5. if (strpos($errorLower, 'table') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return "The required table for {$temporalPeriod} aggregation may not exist. Verify your database structure.";
  7. }
  8. if (strpos($errorLower, 'syntax') !== false) {
  9. return "There was a SQL syntax error. Try rephrasing your query or using a simpler time period.";
  • gyakutsuki

    not included
  1. if (strpos($errorLower, 'table') !== false) {
  2. return "The required table for {$temporalPeriod} aggregation may not exist. Verify your database structure.";
  3. }
  4. if (strpos($errorLower, 'syntax') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. return "There was a SQL syntax error. Try rephrasing your query or using a simpler time period.";
  6. }
  7. if (strpos($errorLower, 'permission') !== false || strpos($errorLower, 'access') !== false) {
  8. return "You may not have permission to access the required data. Contact your administrator.";
  • gyakutsuki

    not included
  1. if (strpos($errorLower, 'syntax') !== false) {
  2. return "There was a SQL syntax error. Try rephrasing your query or using a simpler time period.";
  3. }
  4. if (strpos($errorLower, 'permission') !== false || strpos($errorLower, 'access') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. return "You may not have permission to access the required data. Contact your administrator.";
  6. }
  7. if (strpos($errorLower, 'timeout') !== false) {
  8. return "The query took too long. Try a shorter time range or simpler aggregation.";
  • gyakutsuki

    not included
  1. if (strpos($errorLower, 'permission') !== false || strpos($errorLower, 'access') !== false) {
  2. return "You may not have permission to access the required data. Contact your administrator.";
  3. }
  4. if (strpos($errorLower, 'timeout') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. return "The query took too long. Try a shorter time range or simpler aggregation.";
  6. }
  7. // Default suggestion
  8. return "Try rephrasing your query or using a different temporal period. If the problem persists, contact support.";
  • gyakutsuki

    not included
  1. // Semantic results MUST have sources OR data, unless it's a valid LLM/memory fallback
  2. if (!$hasSources) {
  3. $sourceType = strtolower($finalResult['source_attribution']['source_type'] ?? '');
  4. $isLLMFallback = $hasTextResponse && (
  5. strpos($sourceType, 'llm') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. strpos($sourceType, 'general knowledge') !== false ||
  7. strpos($sourceType, 'conversation') !== false ||
  8. strpos($sourceType, 'memory') !== false
  9. );
  • gyakutsuki

    not included
  1. // Semantic results MUST have sources OR data, unless it's a valid LLM/memory fallback
  2. if (!$hasSources) {
  3. $sourceType = strtolower($finalResult['source_attribution']['source_type'] ?? '');
  4. $isLLMFallback = $hasTextResponse && (
  5. strpos($sourceType, 'llm') !== false ||
  6. strpos($sourceType, 'general knowledge') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. strpos($sourceType, 'conversation') !== false ||
  8. strpos($sourceType, 'memory') !== false
  9. );
  10. if (!$isLLMFallback) {
  • gyakutsuki

    not included
  1. if (!$hasSources) {
  2. $sourceType = strtolower($finalResult['source_attribution']['source_type'] ?? '');
  3. $isLLMFallback = $hasTextResponse && (
  4. strpos($sourceType, 'llm') !== false ||
  5. strpos($sourceType, 'general knowledge') !== false ||
  6. strpos($sourceType, 'conversation') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. strpos($sourceType, 'memory') !== false
  8. );
  9. if (!$isLLMFallback) {
  10. $sourcesStatus = isset($finalResult['sources']) ? 'empty' : 'not set';
  • gyakutsuki

    not included
  1. $sourceType = strtolower($finalResult['source_attribution']['source_type'] ?? '');
  2. $isLLMFallback = $hasTextResponse && (
  3. strpos($sourceType, 'llm') !== false ||
  4. strpos($sourceType, 'general knowledge') !== false ||
  5. strpos($sourceType, 'conversation') !== false ||
  6. strpos($sourceType, 'memory') !== false
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. );
  8. if (!$isLLMFallback) {
  9. $sourcesStatus = isset($finalResult['sources']) ? 'empty' : 'not set';
  10. $dataStatus = isset($finalResult['data']) ? 'empty' : 'not set';
  • gyakutsuki

    not included
  1. private function generateUserFriendlyErrorMessage(array $errors): string
  2. {
  3. // Check for common error patterns and generate appropriate messages
  4. foreach ($errors as $error) {
  5. // Pattern: "Semantic result missing sources and data"
  6. if (strpos($error, 'Semantic result missing sources and data') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return "I couldn't find any information about that in the database. The requested content (like terms and conditions) may not be available yet. Please try asking about something else or contact support to add this content.";
  8. }
  9. // Pattern: "Analytics result missing data"
  10. if (strpos($error, 'Analytics result missing data') !== false) {
  • gyakutsuki

    not included
  1. if (strpos($error, 'Semantic result missing sources and data') !== false) {
  2. return "I couldn't find any information about that in the database. The requested content (like terms and conditions) may not be available yet. Please try asking about something else or contact support to add this content.";
  3. }
  4. // Pattern: "Analytics result missing data"
  5. if (strpos($error, 'Analytics result missing data') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return "I couldn't retrieve the requested data. This might be because there are no records matching your query, or the data hasn't been entered yet. Please try a different query or check if the data exists.";
  7. }
  8. // Pattern: "Hybrid result missing"
  9. if (strpos($error, 'Hybrid result missing') !== false) {
  • gyakutsuki

    not included
  1. if (strpos($error, 'Analytics result missing data') !== false) {
  2. return "I couldn't retrieve the requested data. This might be because there are no records matching your query, or the data hasn't been entered yet. Please try a different query or check if the data exists.";
  3. }
  4. // Pattern: "Hybrid result missing"
  5. if (strpos($error, 'Hybrid result missing') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return "I couldn't complete your request because some of the required information is missing. Please try breaking your question into smaller parts or asking about something else.";
  7. }
  8. // Pattern: "Empty response"
  9. if (strpos($error, 'empty') !== false || strpos($error, 'Empty') !== false) {
  • gyakutsuki

    not included
  1. if (strpos($error, 'Hybrid result missing') !== false) {
  2. return "I couldn't complete your request because some of the required information is missing. Please try breaking your question into smaller parts or asking about something else.";
  3. }
  4. // Pattern: "Empty response"
  5. if (strpos($error, 'empty') !== false || strpos($error, 'Empty') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return "I couldn't find any results for your query. The information you're looking for might not be available in the system yet. Please try rephrasing your question or asking about something else.";
  7. }
  8. }
  9. // Default fallback message
  • gyakutsuki

    not included
  1. // Fallback to source_table if no name found
  2. if ($docName === null && isset($metadata['source_table'])) {
  3. $tableName = $metadata['source_table'];
  4. // Remove prefix and _embedding suffix
  5. $prefix = defined('CLICSHOPPING_DB_TABLE_PREFIX') ? CLICSHOPPING_DB_TABLE_PREFIX : 'clic_';
  6. if (strpos($tableName, $prefix) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. $tableName = substr($tableName, strlen($prefix));
  8. }
  9. $tableName = str_replace('_embedding', '', $tableName);
  10. $tableName = str_replace('_', ' ', $tableName);
  11. $docName = ucwords($tableName);
  • gyakutsuki

    not included
  1. return $entityType;
  2. }
  3. // Remove table prefix if present
  4. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  5. if (!empty($prefix) && strpos($tableName, $prefix) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $tableName = substr($tableName, strlen($prefix));
  7. }
  8. // Remove '_embedding' suffix if present
  9. $tableName = str_replace('_embedding', '', $tableName);
  • gyakutsuki

    not included
  1. }
  2. $keywords[] = $entityType;
  3. $keywords[] = str_replace('_', ' ', $entityType);
  4. if (substr($entityType, -3) === 'ies') {
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  5. $keywords[] = substr($entityType, 0, -3) . 'y';
  6. } elseif (substr($entityType, -1) === 's') {
  7. $keywords[] = substr($entityType, 0, -1);
  8. } else {
  9. $keywords[] = $entityType . 's';
  • gyakutsuki

    not included
  1. $keywords[] = $entityType;
  2. $keywords[] = str_replace('_', ' ', $entityType);
  3. if (substr($entityType, -3) === 'ies') {
  4. $keywords[] = substr($entityType, 0, -3) . 'y';
  5. } elseif (substr($entityType, -1) === 's') {
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. $keywords[] = substr($entityType, 0, -1);
  7. } else {
  8. $keywords[] = $entityType . 's';
  9. }
  10. }
  • gyakutsuki

    not included
  1. * @return bool
  2. */
  3. private function hasKeyword(string $text, array $keywords): bool
  4. {
  5. foreach ($keywords as $keyword) {
  6. if (strpos($text, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return true;
  8. }
  9. }
  10. return false;
  11. }
  • gyakutsuki

    not included
  1. // Simple keyword matching (replaces deleted PatternAnalysisPattern)
  2. $patternKeywords = ['pattern', 'trend', 'style', 'dominant', 'recurring', 'common'];
  3. $queryLower = strtolower($queryToAnalyze);
  4. foreach ($patternKeywords as $keyword) {
  5. if (strpos($queryLower, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. if ($this->debug) {
  7. $this->logDebug("Pattern analysis keyword detected: $keyword");
  8. }
  9. return true;
  10. }
  • gyakutsuki

    not included
  1. // 🔧 FIX: If interpretations array is empty, use defaults based on ambiguity type
  2. if (empty($availableInterpretations)) {
  3. $ambiguityType = $ambiguityAnalysis['ambiguity_type'] ?? '';
  4. // For quantification queries, default to count and sum
  5. if (strpos($ambiguityType, 'quantification') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $availableInterpretations = ['count', 'sum'];
  7. if ($this->debug) {
  8. $this->logger->logSecurityEvent(
  9. "AmbiguityOptimizer: Empty interpretations array, using defaults for quantification: count, sum",
  • gyakutsuki

    not included
  1. // Extract type from column info (now returns array with 'type' and 'comment')
  2. $type = is_array($columnInfo) ? $columnInfo['type'] : $columnInfo;
  3. // Detect ID columns that could be foreign keys
  4. if (preg_match('/_id$/', $column) && strpos($type, 'int') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. $relatedTable = str_replace('_id', '', $column);
  6. // Validate related table name
  7. $safeRelatedTable = InputValidator::sanitizeIdentifier($relatedTable);
  • gyakutsuki

    not included
  1. // Extract type from column info (now returns array with 'type' and 'comment')
  2. $type = is_array($columnInfo) ? $columnInfo['type'] : $columnInfo;
  3. // Detect ID columns that could be foreign keys
  4. if (preg_match('/_id$/', $column) && strpos($type, 'int') !== false) {
    Consider replacing preg_match() with str_ends_with() for improved readability.
    Last edited by clicshopping
  5. $relatedTable = str_replace('_id', '', $column);
  6. // Validate related table name
  7. $safeRelatedTable = InputValidator::sanitizeIdentifier($relatedTable);
  • gyakutsuki

    not included
  1. // Load language definitions
  2. $CLICSHOPPING_Language = Registry::get('Language');
  3. DomainConfig::loadLanguageFile('rag_error_handler');
  4. // Suggestions based on the type of error
  5. if (strpos($errorMessage, 'Unknown column') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return CLICSHOPPING::getDef('text_column_reference_does_not_exist');
  7. }
  8. if (strpos($errorMessage, 'syntax error') !== false) {
  9. return CLICSHOPPING::getDef('text_sql_query_generated_error');
  • gyakutsuki

    not included
  1. // Suggestions based on the type of error
  2. if (strpos($errorMessage, 'Unknown column') !== false) {
  3. return CLICSHOPPING::getDef('text_column_reference_does_not_exist');
  4. }
  5. if (strpos($errorMessage, 'syntax error') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return CLICSHOPPING::getDef('text_sql_query_generated_error');
  7. }
  8. if (strpos($errorMessage, 'Table') !== false && strpos($errorMessage, 'doesn\'t exist') !== false) {
  9. return CLICSHOPPING::getDef('text_table_referenced_does_not_exist');
  • gyakutsuki

    not included
  1. if (strpos($errorMessage, 'syntax error') !== false) {
  2. return CLICSHOPPING::getDef('text_sql_query_generated_error');
  3. }
  4. if (strpos($errorMessage, 'Table') !== false && strpos($errorMessage, 'doesn\'t exist') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. return CLICSHOPPING::getDef('text_table_referenced_does_not_exist');
  6. }
  7. // Generic suggestion
  8. return CLICSHOPPING::getDef('text_error_executing_query');
  • gyakutsuki

    not included
  1. if ($this->debug) {
  2. error_log("AmbiguousQueryDetector: LLM returned empty interpretations for ambiguous query, generating defaults");
  3. }
  4. // Generate default interpretations based on ambiguity type
  5. if (strpos($ambiguityType, 'quantification') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. // For quantification queries: count vs sum
  7. $interpretations = [
  8. [
  9. 'type' => 'count',
  10. 'label' => 'Count of items',
  • gyakutsuki

    not included
  1. 'label' => 'Sum of quantities',
  2. 'description' => 'Sum the total quantity',
  3. 'sql_hint' => 'Use SUM(quantity_field)'
  4. ]
  5. ];
  6. } else if (strpos($ambiguityType, 'scope') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. // For scope queries: all vs recent
  8. $interpretations = [
  9. [
  10. 'type' => 'all',
  11. 'label' => 'All items',
  • gyakutsuki

    not included
  1. $isHtmlContent = false;
  2. if (isset($results['text_response']) && !empty($results['text_response'])) {
  3. $interpretationText = $results['text_response'];
  4. // Check if text_response contains HTML
  5. $isHtmlContent = (strpos($interpretationText, '<div') !== false || strpos($interpretationText, '<p>') !== false);
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. } elseif (isset($results['interpretation']) && $results['interpretation'] !== 'Array') {
  7. $interpretationText = $results['interpretation'];
  8. }
  9. if (!empty($interpretationText)) {
  • gyakutsuki

    not included
  1. public static function hasTemporalConnector(string $query): bool
  2. {
  3. $query = strtolower($query);
  4. foreach (self::$temporalConnectors as $connector) {
  5. if (strpos($query, $connector) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. return false;
  • gyakutsuki

    not included
  1. {
  2. $query = strtolower($query);
  3. $detected = [];
  4. foreach (self::$temporalConnectors as $connector) {
  5. if (strpos($query, $connector) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $detected[] = $connector;
  7. }
  8. }
  9. return $detected;
  • gyakutsuki

    not included
  1. public static function hasFinancialMetric(string $query): bool
  2. {
  3. $query = strtolower($query);
  4. foreach (self::$financialMetrics as $metric) {
  5. if (strpos($query, $metric) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. return false;
  • gyakutsuki

    not included
  1. public static function extractBaseMetric(string $query): ?string
  2. {
  3. $query = strtolower($query);
  4. foreach (self::FINANCIAL_METRICS as $pattern => $metric) {
  5. if (strpos($query, $pattern) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $metric;
  7. }
  8. }
  9. return null;
  • gyakutsuki

    not included
  1. return "year {$matches[2]}";
  2. }
  3. // Check for relative time patterns
  4. foreach (self::RELATIVE_TIME_PATTERNS as $pattern => $range) {
  5. if (strpos($query, $pattern) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $range;
  7. }
  8. }
  9. return null;
  • gyakutsuki

    not included
  1. public static function hasSuperlativePattern(string $query): bool
  2. {
  3. $query = strtolower($query);
  4. foreach (SuperlativePatterns::$superlativeKeywords as $pattern) {
  5. if (strpos($query, $pattern) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. return false;
  • gyakutsuki

    not included
  1. public static function hasEntityKeyword(string $query): bool
  2. {
  3. $query = strtolower($query);
  4. foreach (SuperlativePatterns::$entityKeywords as $entity) {
  5. if (strpos($query, $entity) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. return false;
  • gyakutsuki

    not included
  1. {
  2. $query = strtolower($query);
  3. $detected = [];
  4. foreach (SuperlativePatterns::$superlativeKeywords as $pattern) {
  5. if (strpos($query, $pattern) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $detected[] = $pattern;
  7. }
  8. }
  9. return $detected;
  • gyakutsuki

    not included
  1. {
  2. $query = strtolower($query);
  3. $detected = [];
  4. foreach (SuperlativePatterns::$entityKeywords as $entity) {
  5. if (strpos($query, $entity) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $detected[] = $entity;
  7. }
  8. }
  9. return $detected;
  • gyakutsuki

    not included
  1. }
  2. // Check for relative time patterns
  3. $relativePatterns = self::getRelativeTimePatterns();
  4. foreach ($relativePatterns as $pattern => $range) {
  5. if (strpos($query, $pattern) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $range;
  7. }
  8. }
  9. // Check for date range patterns (e.g., "from January to March")
  • gyakutsuki

    not included
  1. */
  2. private static function getApiKey(): string
  3. {
  4. $api_key = CLICSHOPPING_APP_CHATGPT_CH_API_KEY;
  5. if (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'mistral') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. $api_key = CLICSHOPPING_APP_CHATGPT_CH_API_KEY_MISTRAL;
  7. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage') === 0) {
  8. $api_key = CLICSHOPPING_APP_CHATGPT_RA_API_KEY_VOYAGE_AI;
  9. }
  • gyakutsuki

    not included
  1. {
  2. $api_key = CLICSHOPPING_APP_CHATGPT_CH_API_KEY;
  3. if (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'mistral') === 0) {
  4. $api_key = CLICSHOPPING_APP_CHATGPT_CH_API_KEY_MISTRAL;
  5. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. $api_key = CLICSHOPPING_APP_CHATGPT_RA_API_KEY_VOYAGE_AI;
  7. }
  8. return $api_key;
  9. }
  • gyakutsuki

    not included
  1. * @param string $model The embedding model to check
  2. * @return bool True if API keys are available, false otherwise
  3. */
  4. private static function checkApiKeys(string $model): bool
  5. {
  6. if (strpos($model, 'gpt') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  7. return !empty(CLICSHOPPING_APP_CHATGPT_CH_API_KEY);
  8. } elseif (strpos($model, 'mistral') === 0) {
  9. return !empty(CLICSHOPPING_APP_CHATGPT_CH_API_KEY_MISTRAL);
  10. } elseif (strpos($model, 'voyage') === 0) {
  11. return !empty(CLICSHOPPING_APP_CHATGPT_RA_API_KEY_VOYAGE_AI);
  • gyakutsuki

    not included
  1. */
  2. private static function checkApiKeys(string $model): bool
  3. {
  4. if (strpos($model, 'gpt') === 0) {
  5. return !empty(CLICSHOPPING_APP_CHATGPT_CH_API_KEY);
  6. } elseif (strpos($model, 'mistral') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  7. return !empty(CLICSHOPPING_APP_CHATGPT_CH_API_KEY_MISTRAL);
  8. } elseif (strpos($model, 'voyage') === 0) {
  9. return !empty(CLICSHOPPING_APP_CHATGPT_RA_API_KEY_VOYAGE_AI);
  10. } elseif (strpos($model, 'ollama') === 0) {
  11. return true;
  • gyakutsuki

    not included
  1. {
  2. if (strpos($model, 'gpt') === 0) {
  3. return !empty(CLICSHOPPING_APP_CHATGPT_CH_API_KEY);
  4. } elseif (strpos($model, 'mistral') === 0) {
  5. return !empty(CLICSHOPPING_APP_CHATGPT_CH_API_KEY_MISTRAL);
  6. } elseif (strpos($model, 'voyage') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  7. return !empty(CLICSHOPPING_APP_CHATGPT_RA_API_KEY_VOYAGE_AI);
  8. } elseif (strpos($model, 'ollama') === 0) {
  9. return true;
  10. }
  • gyakutsuki

    not included
  1. return !empty(CLICSHOPPING_APP_CHATGPT_CH_API_KEY);
  2. } elseif (strpos($model, 'mistral') === 0) {
  3. return !empty(CLICSHOPPING_APP_CHATGPT_CH_API_KEY_MISTRAL);
  4. } elseif (strpos($model, 'voyage') === 0) {
  5. return !empty(CLICSHOPPING_APP_CHATGPT_RA_API_KEY_VOYAGE_AI);
  6. } elseif (strpos($model, 'ollama') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  7. return true;
  8. }
  9. return false;
  10. }
  • gyakutsuki

    not included
  1. return null;
  2. }
  3. $api_key = self::getApiKey();
  4. if (strpos($model, 'gpt-large') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  5. $config = new OpenAIConfig();
  6. $config->apiKey = $api_key;
  7. return new OpenAI3LargeEmbeddingGenerator($config);
  8. } elseif (strpos($model, 'gpt-medium') === 0) {
  9. $config = new OpenAIConfig();
  • gyakutsuki

    not included
  1. if (strpos($model, 'gpt-large') === 0) {
  2. $config = new OpenAIConfig();
  3. $config->apiKey = $api_key;
  4. return new OpenAI3LargeEmbeddingGenerator($config);
  5. } elseif (strpos($model, 'gpt-medium') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. $config = new OpenAIConfig();
  7. $config->apiKey = $api_key;
  8. return new OpenAI3SmallEmbeddingGenerator($config);
  9. } elseif (strpos($model, 'mistral') === 0) {
  10. $config = new OpenAIConfig();
  • gyakutsuki

    not included
  1. return new OpenAI3LargeEmbeddingGenerator($config);
  2. } elseif (strpos($model, 'gpt-medium') === 0) {
  3. $config = new OpenAIConfig();
  4. $config->apiKey = $api_key;
  5. return new OpenAI3SmallEmbeddingGenerator($config);
  6. } elseif (strpos($model, 'mistral') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  7. $config = new OpenAIConfig();
  8. $config->apiKey = $api_key;
  9. return new MistralEmbeddingGenerator($config);
  10. } elseif (strpos($model, 'voyage3-large') === 0) {
  11. $config = new VoyageAIConfig();
  • gyakutsuki

    not included
  1. return new OpenAI3SmallEmbeddingGenerator($config);
  2. } elseif (strpos($model, 'mistral') === 0) {
  3. $config = new OpenAIConfig();
  4. $config->apiKey = $api_key;
  5. return new MistralEmbeddingGenerator($config);
  6. } elseif (strpos($model, 'voyage3-large') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  7. $config = new VoyageAIConfig();
  8. $config->apiKey = $api_key;
  9. return new Voyage3LargeEmbeddingGenerator($config);
  10. } elseif (strpos($model, 'voyage3-lite') === 0) {
  11. $config = new VoyageAIConfig();
  • gyakutsuki

    not included
  1. return new MistralEmbeddingGenerator($config);
  2. } elseif (strpos($model, 'voyage3-large') === 0) {
  3. $config = new VoyageAIConfig();
  4. $config->apiKey = $api_key;
  5. return new Voyage3LargeEmbeddingGenerator($config);
  6. } elseif (strpos($model, 'voyage3-lite') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  7. $config = new VoyageAIConfig();
  8. $config->apiKey = $api_key;
  9. return new Voyage3LiteEmbeddingGenerator($config);
  10. } elseif (strpos($model, 'voyage3') === 0) {
  11. $config = new VoyageAIConfig();
  • gyakutsuki

    not included
  1. return new Voyage3LargeEmbeddingGenerator($config);
  2. } elseif (strpos($model, 'voyage3-lite') === 0) {
  3. $config = new VoyageAIConfig();
  4. $config->apiKey = $api_key;
  5. return new Voyage3LiteEmbeddingGenerator($config);
  6. } elseif (strpos($model, 'voyage3') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  7. $config = new VoyageAIConfig();
  8. $config->apiKey = $api_key;
  9. return new Voyage3EmbeddingGenerator($config);
  10. } else {
  11. return new OllamaEmbeddingGenerator($model);
  • gyakutsuki

    not included
  1. $errorMessage .= " (estimated tokens: {$estimatedTokens}, chunk size: {$token_length})";
  2. }
  3. error_log($errorMessage);
  4. if (strpos($e->getMessage(), 'maximum context length') !== false && $token_length > 200) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. error_log("Retrying with smaller chunk size...");
  6. return self::createEmbedding($path_file_upload, $text_description, (int)($token_length / 2));
  7. }
  8. return null;
  • gyakutsuki

    not included
  1. */
  2. private static function estimateTokenCount(string $text): int
  3. {
  4. $model = CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL;
  5. if (strpos($model, 'gpt') === 0 || strpos($model, 'voyage') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $avgCharsPerToken = 3.5;
  7. return (int)ceil(strlen($text) / $avgCharsPerToken);
  8. }
  9. return (int)ceil(strlen($text) / 4);
  • gyakutsuki

    not included
  1. *
  2. * @return int The embedding length in dimensions for the selected model
  3. */
  4. public static function getEmbeddingLength(): int
  5. {
  6. if (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'gpt-large') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. return 3072;
  8. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'gpt-medium') === 0) {
  9. return 1536;
  10. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'mistral') === 0) {
  11. return 1024;
  • gyakutsuki

    not included
  1. */
  2. public static function getEmbeddingLength(): int
  3. {
  4. if (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'gpt-large') === 0) {
  5. return 3072;
  6. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'gpt-medium') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. return 1536;
  8. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'mistral') === 0) {
  9. return 1024;
  10. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-large') === 0) {
  11. return 4096;
  • gyakutsuki

    not included
  1. {
  2. if (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'gpt-large') === 0) {
  3. return 3072;
  4. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'gpt-medium') === 0) {
  5. return 1536;
  6. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'mistral') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. return 1024;
  8. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-large') === 0) {
  9. return 4096;
  10. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-lite') === 0) {
  11. return 384;
  • gyakutsuki

    not included
  1. return 3072;
  2. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'gpt-medium') === 0) {
  3. return 1536;
  4. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'mistral') === 0) {
  5. return 1024;
  6. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-large') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. return 4096;
  8. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-lite') === 0) {
  9. return 384;
  10. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3') === 0) {
  11. return 1024;
  • gyakutsuki

    not included
  1. return 1536;
  2. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'mistral') === 0) {
  3. return 1024;
  4. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-large') === 0) {
  5. return 4096;
  6. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-lite') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. return 384;
  8. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3') === 0) {
  9. return 1024;
  10. } else {
  11. return 1536;
  • gyakutsuki

    not included
  1. return 1024;
  2. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-large') === 0) {
  3. return 4096;
  4. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3-lite') === 0) {
  5. return 384;
  6. } elseif (strpos(CLICSHOPPING_APP_CHATGPT_RA_EMBEDDING_MODEL, 'voyage3') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. return 1024;
  8. } else {
  9. return 1536;
  10. }
  11. }
  • gyakutsuki

    not included
  1. 'voyage3-lite' => 4000,
  2. 'nomic-embed-text' => 8192,
  3. ];
  4. foreach ($contextLengths as $modelPrefix => $length) {
  5. if (strpos($model, $modelPrefix) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. return $length;
  7. }
  8. }
  9. return 4096;
  • gyakutsuki

    not included
  1. 'voyage3-lite' => 300,
  2. 'nomic-embed-text' => 800,
  3. ];
  4. foreach ($chunkSizes as $modelPrefix => $size) {
  5. if (strpos($model, $modelPrefix) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. return $size;
  7. }
  8. }
  9. return 500;
  • gyakutsuki

    not included
  1. * @param string $model
  2. * @return string
  3. */
  4. private static function getModelProvider(string $model): string
  5. {
  6. if (strpos($model, 'gpt') === 0) return 'openai';
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. if (strpos($model, 'mistral') === 0) return 'mistral';
  8. if (strpos($model, 'voyage') === 0) return 'voyageai';
  9. if (strpos($model, 'nomic') === 0) return 'ollama';
  10. return 'unknown';
  • gyakutsuki

    not included
  1. * @return string
  2. */
  3. private static function getModelProvider(string $model): string
  4. {
  5. if (strpos($model, 'gpt') === 0) return 'openai';
  6. if (strpos($model, 'mistral') === 0) return 'mistral';
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. if (strpos($model, 'voyage') === 0) return 'voyageai';
  8. if (strpos($model, 'nomic') === 0) return 'ollama';
  9. return 'unknown';
  10. }
  • gyakutsuki

    not included
  1. */
  2. private static function getModelProvider(string $model): string
  3. {
  4. if (strpos($model, 'gpt') === 0) return 'openai';
  5. if (strpos($model, 'mistral') === 0) return 'mistral';
  6. if (strpos($model, 'voyage') === 0) return 'voyageai';
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. if (strpos($model, 'nomic') === 0) return 'ollama';
  8. return 'unknown';
  9. }
  • gyakutsuki

    not included
  1. private static function getModelProvider(string $model): string
  2. {
  3. if (strpos($model, 'gpt') === 0) return 'openai';
  4. if (strpos($model, 'mistral') === 0) return 'mistral';
  5. if (strpos($model, 'voyage') === 0) return 'voyageai';
  6. if (strpos($model, 'nomic') === 0) return 'ollama';
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. return 'unknown';
  8. }
  9. //*********************
  • gyakutsuki

    not included
  1. if ($value === null) {
  2. return null;
  3. }
  4. // Si la valeur est déjà une chaîne formatée correctement, la retourner telle quelle
  5. if (is_string($value) && strpos($value, '[') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. return $value;
  7. }
  8. // Convertir le tableau en chaîne formatée pour MariaDB
  9. if (is_array($value)) {
  • gyakutsuki

    not included
  1. if (isset($specialCases[$entityType])) {
  2. return $specialCases[$entityType];
  3. }
  4. // Handle compound words with underscores (e.g., "return_orders" -> "return_order")
  5. if (strpos($entityType, '_') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $parts = explode('_', $entityType);
  7. $lastPart = array_pop($parts);
  8. // Apply singularization to the last part only
  9. $singularLastPart = self::singularizeWord($lastPart);
  • gyakutsuki

    not included
  1. if (strlen($word) < 2) {
  2. return $word;
  3. }
  4. // Words ending in "ies" -> "y" (e.g., "categories" -> "category")
  5. if (substr($word, -3) === 'ies') {
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. return substr($word, 0, -3) . 'y';
  7. }
  8. // Words ending in "es" -> remove "es" (e.g., "boxes" -> "box")
  9. if (substr($word, -2) === 'es') {
  • gyakutsuki

    not included
  1. if (substr($word, -3) === 'ies') {
  2. return substr($word, 0, -3) . 'y';
  3. }
  4. // Words ending in "es" -> remove "es" (e.g., "boxes" -> "box")
  5. if (substr($word, -2) === 'es') {
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. return substr($word, 0, -2);
  7. }
  8. // Words ending in "s" -> remove "s" (e.g., "products" -> "product")
  9. if (substr($word, -1) === 's') {
  • gyakutsuki

    not included
  1. if (substr($word, -2) === 'es') {
  2. return substr($word, 0, -2);
  3. }
  4. // Words ending in "s" -> remove "s" (e.g., "products" -> "product")
  5. if (substr($word, -1) === 's') {
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. return substr($word, 0, -1);
  7. }
  8. // No change needed
  9. return $word;
  • gyakutsuki

    not included
  1. if (isset($specialCases[$entityType])) {
  2. return $specialCases[$entityType];
  3. }
  4. // Handle compound words with underscores
  5. if (strpos($entityType, '_') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $parts = explode('_', $entityType);
  7. $lastPart = array_pop($parts);
  8. // Apply pluralization to the last part only
  9. $pluralLastPart = self::pluralizeWord($lastPart);
  • gyakutsuki

    not included
  1. if (strlen($word) < 2) {
  2. return $word;
  3. }
  4. // Words ending in "y" -> "ies" (e.g., "category" -> "categories")
  5. if (substr($word, -1) === 'y') {
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. return substr($word, 0, -1) . 'ies';
  7. }
  8. // Words ending in "s", "x", "z", "ch", "sh" -> add "es"
  9. if (preg_match('/(s|x|z|ch|sh)$/i', $word)) {
  • gyakutsuki

    not included
  1. // Check for table names in FROM clause
  2. foreach ($entityColumnMap as $columnName => $entityType) {
  3. $tableName = str_replace('_id', '', $columnName);
  4. // Check if table name appears in query
  5. if (strpos($sqlLower, "from {$tableName}") !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. strpos($sqlLower, "from clic_{$tableName}") !== false ||
  7. strpos($sqlLower, "join {$tableName}") !== false ||
  8. strpos($sqlLower, "join clic_{$tableName}") !== false) {
  9. return [
  • gyakutsuki

    not included
  1. foreach ($entityColumnMap as $columnName => $entityType) {
  2. $tableName = str_replace('_id', '', $columnName);
  3. // Check if table name appears in query
  4. if (strpos($sqlLower, "from {$tableName}") !== false ||
  5. strpos($sqlLower, "from clic_{$tableName}") !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. strpos($sqlLower, "join {$tableName}") !== false ||
  7. strpos($sqlLower, "join clic_{$tableName}") !== false) {
  8. return [
  9. 'entity_id' => null, // Can't extract ID from query alone
  • gyakutsuki

    not included
  1. $tableName = str_replace('_id', '', $columnName);
  2. // Check if table name appears in query
  3. if (strpos($sqlLower, "from {$tableName}") !== false ||
  4. strpos($sqlLower, "from clic_{$tableName}") !== false ||
  5. strpos($sqlLower, "join {$tableName}") !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. strpos($sqlLower, "join clic_{$tableName}") !== false) {
  7. return [
  8. 'entity_id' => null, // Can't extract ID from query alone
  9. 'entity_type' => $entityType,
  • gyakutsuki

    not included
  1. // Check if table name appears in query
  2. if (strpos($sqlLower, "from {$tableName}") !== false ||
  3. strpos($sqlLower, "from clic_{$tableName}") !== false ||
  4. strpos($sqlLower, "join {$tableName}") !== false ||
  5. strpos($sqlLower, "join clic_{$tableName}") !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return [
  7. 'entity_id' => null, // Can't extract ID from query alone
  8. 'entity_type' => $entityType,
  9. ];
  • gyakutsuki

    not included
  1. {
  2. $markers = self::getResetMarkers();
  3. $queryLower = mb_strtolower($query);
  4. foreach ($markers as $marker) {
  5. if (strpos($queryLower, $marker) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. return false;
  • gyakutsuki

    not included
  1. $markers = self::getResetMarkers();
  2. $queryLower = mb_strtolower($query);
  3. $foundMarkers = [];
  4. foreach ($markers as $marker) {
  5. if (strpos($queryLower, $marker) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $foundMarkers[] = $marker;
  7. }
  8. }
  9. $hasReset = !empty($foundMarkers);
  • gyakutsuki

    not included
  1. {
  2. $keywords = self::getModificationKeywords();
  3. $queryLower = mb_strtolower($query);
  4. foreach ($keywords as $keyword) {
  5. if (strpos($queryLower, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. return false;
  • gyakutsuki

    not included
  1. {
  2. $keywords = self::getModificationKeywords();
  3. $queryLower = mb_strtolower($query);
  4. foreach ($keywords as $keyword) {
  5. if (strpos($queryLower, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $keyword;
  7. }
  8. }
  9. return null;
  • gyakutsuki

    not included
  1. $isHtmlContent = false;
  2. if (isset($results['text_response']) && !empty($results['text_response'])) {
  3. $interpretationText = $results['text_response'];
  4. // Check if text_response contains HTML
  5. $isHtmlContent = (strpos($interpretationText, '<div') !== false || strpos($interpretationText, '<p>') !== false);
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. } elseif (isset($results['response']) && !empty($results['response'])) {
  7. $interpretationText = $results['response'];
  8. } elseif (isset($results['interpretation']) && $results['interpretation'] !== 'Array') {
  9. $interpretationText = $results['interpretation'];
  10. }
  • gyakutsuki

    not included
  1. $tableName = $metadata['source_table'];
  2. // Remove prefix and _embedding suffix
  3. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  4. if (strpos($tableName, $prefix) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  5. $tableName = substr($tableName, strlen($prefix));
  6. }
  7. $tableName = str_replace('_embedding', '', $tableName);
  8. $tableName = str_replace('_', ' ', $tableName);
  9. $docName = ucwords($tableName);
  • gyakutsuki

    not included
  1. foreach ($termGroups as $groupType => $terms) {
  2. $weight = $this->termWeights[$groupType] ?? 0.5;
  3. foreach ($terms as $term) {
  4. if (strpos($query, $term) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. $domainScore += $weight;
  6. $matchedTerms[] = [
  7. 'term' => $term,
  8. 'type' => $groupType,
  9. 'weight' => $weight,
  • gyakutsuki

    not included
  1. $supplierBonus = 0;
  2. $manufacturerBonus = 0;
  3. foreach ($supplierIndicators as $indicator) {
  4. if (strpos($query, $indicator) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. $supplierBonus += 1.0;
  6. }
  7. }
  8. foreach ($manufacturerIndicators as $indicator) {
  • gyakutsuki

    not included
  1. $supplierBonus += 1.0;
  2. }
  3. }
  4. foreach ($manufacturerIndicators as $indicator) {
  5. if (strpos($query, $indicator) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $manufacturerBonus += 1.0;
  7. }
  8. }
  9. $scores['suppliers']['score'] += $supplierBonus;
  • gyakutsuki

    not included
  1. if (abs($reviewScore - $sentimentScore) < 0.5) {
  2. $sentimentIndicators = ['sentiment', 'feeling', 'positive', 'negative', 'emotion', 'analysis'];
  3. $sentimentBonus = 0;
  4. foreach ($sentimentIndicators as $indicator) {
  5. if (strpos($query, $indicator) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $sentimentBonus += 0.5;
  7. }
  8. }
  9. if ($sentimentBonus > 0) {
  • gyakutsuki

    not included
  1. 'wrong category',
  2. 'incorrect classification'
  3. ];
  4. foreach ($classificationKeywords as $keyword) {
  5. if (strpos($comment, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. if ($reason === 'irrelevant') {
  • gyakutsuki

    not included
  1. $isClassificationError = false;
  2. $errorType = 'unknown';
  3. // Detect classification errors
  4. if (strpos($comment, 'wrong type') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. strpos($comment, 'misclassified') !== false ||
  6. strpos($comment, 'should be analytics') !== false ||
  7. strpos($comment, 'should be semantic') !== false) {
  8. $isClassificationError = true;
  9. $errorType = 'misclassification';
  • gyakutsuki

    not included
  1. $isClassificationError = false;
  2. $errorType = 'unknown';
  3. // Detect classification errors
  4. if (strpos($comment, 'wrong type') !== false ||
  5. strpos($comment, 'misclassified') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. strpos($comment, 'should be analytics') !== false ||
  7. strpos($comment, 'should be semantic') !== false) {
  8. $isClassificationError = true;
  9. $errorType = 'misclassification';
  10. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
  • gyakutsuki

    not included
  1. $errorType = 'unknown';
  2. // Detect classification errors
  3. if (strpos($comment, 'wrong type') !== false ||
  4. strpos($comment, 'misclassified') !== false ||
  5. strpos($comment, 'should be analytics') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. strpos($comment, 'should be semantic') !== false) {
  7. $isClassificationError = true;
  8. $errorType = 'misclassification';
  9. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
  10. $isClassificationError = true;
  • gyakutsuki

    not included
  1. // Detect classification errors
  2. if (strpos($comment, 'wrong type') !== false ||
  3. strpos($comment, 'misclassified') !== false ||
  4. strpos($comment, 'should be analytics') !== false ||
  5. strpos($comment, 'should be semantic') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $isClassificationError = true;
  7. $errorType = 'misclassification';
  8. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
  9. $isClassificationError = true;
  10. $errorType = 'irrelevant_result';
  • gyakutsuki

    not included
  1. strpos($comment, 'misclassified') !== false ||
  2. strpos($comment, 'should be analytics') !== false ||
  3. strpos($comment, 'should be semantic') !== false) {
  4. $isClassificationError = true;
  5. $errorType = 'misclassification';
  6. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. $isClassificationError = true;
  8. $errorType = 'irrelevant_result';
  9. } elseif ($reason === 'incomplete' && strpos($comment, 'wrong') !== false) {
  10. $isClassificationError = true;
  11. $errorType = 'partial_misclassification';
  • gyakutsuki

    not included
  1. $isClassificationError = true;
  2. $errorType = 'misclassification';
  3. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
  4. $isClassificationError = true;
  5. $errorType = 'irrelevant_result';
  6. } elseif ($reason === 'incomplete' && strpos($comment, 'wrong') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. $isClassificationError = true;
  8. $errorType = 'partial_misclassification';
  9. }
  10. if ($isClassificationError) {
  • gyakutsuki

    not included
  1. $isClassificationError = false;
  2. $errorType = 'unknown';
  3. // Detect classification errors
  4. if (strpos($comment, 'wrong type') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. strpos($comment, 'misclassified') !== false ||
  6. strpos($comment, 'should be analytics') !== false ||
  7. strpos($comment, 'should be semantic') !== false) {
  8. $isClassificationError = true;
  9. $errorType = 'misclassification';
  • gyakutsuki

    not included
  1. $isClassificationError = false;
  2. $errorType = 'unknown';
  3. // Detect classification errors
  4. if (strpos($comment, 'wrong type') !== false ||
  5. strpos($comment, 'misclassified') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. strpos($comment, 'should be analytics') !== false ||
  7. strpos($comment, 'should be semantic') !== false) {
  8. $isClassificationError = true;
  9. $errorType = 'misclassification';
  10. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
  • gyakutsuki

    not included
  1. $errorType = 'unknown';
  2. // Detect classification errors
  3. if (strpos($comment, 'wrong type') !== false ||
  4. strpos($comment, 'misclassified') !== false ||
  5. strpos($comment, 'should be analytics') !== false ||
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. strpos($comment, 'should be semantic') !== false) {
  7. $isClassificationError = true;
  8. $errorType = 'misclassification';
  9. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
  10. $isClassificationError = true;
  • gyakutsuki

    not included
  1. // Detect classification errors
  2. if (strpos($comment, 'wrong type') !== false ||
  3. strpos($comment, 'misclassified') !== false ||
  4. strpos($comment, 'should be analytics') !== false ||
  5. strpos($comment, 'should be semantic') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $isClassificationError = true;
  7. $errorType = 'misclassification';
  8. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
  9. $isClassificationError = true;
  10. $errorType = 'irrelevant_result';
  • gyakutsuki

    not included
  1. strpos($comment, 'misclassified') !== false ||
  2. strpos($comment, 'should be analytics') !== false ||
  3. strpos($comment, 'should be semantic') !== false) {
  4. $isClassificationError = true;
  5. $errorType = 'misclassification';
  6. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. $isClassificationError = true;
  8. $errorType = 'irrelevant_result';
  9. } elseif ($reason === 'incomplete' && strpos($comment, 'wrong') !== false) {
  10. $isClassificationError = true;
  11. $errorType = 'partial_misclassification';
  • gyakutsuki

    not included
  1. $isClassificationError = true;
  2. $errorType = 'misclassification';
  3. } elseif ($reason === 'irrelevant' || strpos($comment, 'irrelevant') !== false) {
  4. $isClassificationError = true;
  5. $errorType = 'irrelevant_result';
  6. } elseif ($reason === 'incomplete' && strpos($comment, 'wrong') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. $isClassificationError = true;
  8. $errorType = 'partial_misclassification';
  9. }
  10. if ($isClassificationError) {
  • gyakutsuki

    not included
  1. if (preg_match('/is:\s*["\'](.+?)["\']$/i', $cleaned, $matches)) {
  2. $cleaned = $matches[1];
  3. }
  4. // STEP 4: Remove leading/trailing quotes if they wrap the entire string
  5. if ((substr($cleaned, 0, 1) === '"' && substr($cleaned, -1) === '"') ||
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. (substr($cleaned, 0, 1) === "'" && substr($cleaned, -1) === "'")) {
  7. $cleaned = substr($cleaned, 1, -1);
  8. }
  9. return trim($cleaned);
  • gyakutsuki

    not included
  1. if (preg_match('/is:\s*["\'](.+?)["\']$/i', $cleaned, $matches)) {
  2. $cleaned = $matches[1];
  3. }
  4. // STEP 4: Remove leading/trailing quotes if they wrap the entire string
  5. if ((substr($cleaned, 0, 1) === '"' && substr($cleaned, -1) === '"') ||
    Consider replacing substr() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. (substr($cleaned, 0, 1) === "'" && substr($cleaned, -1) === "'")) {
  7. $cleaned = substr($cleaned, 1, -1);
  8. }
  9. return trim($cleaned);
  • gyakutsuki

    not included
  1. $cleaned = $matches[1];
  2. }
  3. // STEP 4: Remove leading/trailing quotes if they wrap the entire string
  4. if ((substr($cleaned, 0, 1) === '"' && substr($cleaned, -1) === '"') ||
  5. (substr($cleaned, 0, 1) === "'" && substr($cleaned, -1) === "'")) {
    Consider replacing substr() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. $cleaned = substr($cleaned, 1, -1);
  7. }
  8. return trim($cleaned);
  9. }
  • gyakutsuki

    not included
  1. $cleaned = $matches[1];
  2. }
  3. // STEP 4: Remove leading/trailing quotes if they wrap the entire string
  4. if ((substr($cleaned, 0, 1) === '"' && substr($cleaned, -1) === '"') ||
  5. (substr($cleaned, 0, 1) === "'" && substr($cleaned, -1) === "'")) {
    Consider replacing substr() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $cleaned = substr($cleaned, 1, -1);
  7. }
  8. return trim($cleaned);
  9. }
  • gyakutsuki

    not included
  1. if ($this->debug) {
  2. error_log('[WebSearchFormatter] Formatting web search results\n');
  3. error_log('[WebSearchFormatter] Result keys: ' . implode(', ', array_keys($results)) . "\n");
  4. error_log('[WebSearchFormatter] Has text_response: ' . (isset($results['text_response']) ? 'YES' : 'NO') . "\n");
  5. if (isset($results['text_response'])) {
  6. $isHtml = (strpos($results['text_response'], '<') !== false);
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. error_log('[WebSearchFormatter] text_response is HTML: ' . ($isHtml ? 'YES' : 'NO') . "\n");
  8. error_log('[WebSearchFormatter] text_response length: ' . strlen($results['text_response']) . "\n");
  9. }
  10. }
  • gyakutsuki

    not included
  1. $isHtmlContent = false;
  2. if (isset($results['text_response']) && !empty($results['text_response'])) {
  3. $interpretationText = $results['text_response'];
  4. // Check if text_response contains HTML (from ResultSynthesizer)
  5. $isHtmlContent = (strpos($interpretationText, '<div') !== false || strpos($interpretationText, '<p>') !== false);
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. } elseif (isset($results['interpretation']) && $results['interpretation'] !== 'Array') {
  7. $interpretationText = $results['interpretation'];
  8. } elseif (isset($results['response']) && !empty($results['response'])) {
  9. $interpretationText = $results['response'];
  10. }
  • gyakutsuki

    not included
  1. // Check if query has entity keywords (database query, not web search)
  2. // 🔧 MIGRATION: Use centralized EntityKeywordsPattern instead of WebSearchPatterns
  3. $hasEntityKeyword = false;
  4. foreach (WebSearchPatterns::getEntityKeywords() as $entity) {
  5. if (strpos($query, $entity) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $hasEntityKeyword = true;
  7. break;
  8. }
  9. }
  • gyakutsuki

    not included
  1. }
  2. // Check if query has financial metric keywords (analytics query, not web search)
  3. $hasFinancialKeyword = false;
  4. foreach ($financialMetricKeywords as $keyword) {
  5. if (strpos($query, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $hasFinancialKeyword = true;
  7. break;
  8. }
  9. }
  • gyakutsuki

    not included
  1. }
  2. // Only apply trends/news override if NO entity keywords AND NO financial keywords present
  3. if (!$hasEntityKeyword && !$hasFinancialKeyword) {
  4. foreach (WebSearchPatterns::$trendsNewsKeywords as $keyword) {
  5. if (strpos($query, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $analysis['intent_type'] = 'web_search';
  7. $analysis['confidence'] = 0.95;
  8. $analysis['override_reason'] = "Trends/news keyword detected: $keyword (no entity/financial keywords)";
  9. $analysis['detection_method'] = 'pattern_post_filter';
  10. return $analysis;
  • gyakutsuki

    not included
  1. // ========================================================================
  2. // STEP 2: Check for competitor keywords (ENGLISH ONLY)
  3. // ========================================================================
  4. foreach (WebSearchPatterns::$competitorKeywords as $keyword) {
  5. if (strpos($query, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $analysis['intent_type'] = 'web_search';
  7. $analysis['confidence'] = 0.95;
  8. $analysis['override_reason'] = "Competitor keyword detected: $keyword";
  9. $analysis['detection_method'] = 'pattern_post_filter';
  10. return $analysis;
  • gyakutsuki

    not included
  1. $externalSites[] = strtolower($row['site_domain']);
  2. }
  3. // Check if query mentions any configured external site
  4. foreach ($externalSites as $site) {
  5. if (strpos($query, $site) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $analysis['intent_type'] = 'web_search';
  7. $analysis['confidence'] = 0.95;
  8. $analysis['override_reason'] = "External site detected: $site (from database)";
  9. $analysis['detection_method'] = 'pattern_post_filter';
  10. return $analysis;
  • gyakutsuki

    not included
  1. // Only check comparison if query is price-related
  2. $hasPriceKeyword = false;
  3. foreach (WebSearchPatterns::$priceKeywords as $priceWord) {
  4. if (strpos($query, $priceWord) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. $hasPriceKeyword = true;
  6. break;
  7. }
  8. }
  • gyakutsuki

    not included
  1. }
  2. }
  3. if ($hasPriceKeyword) {
  4. foreach (WebSearchPatterns::$comparisonKeywords as $keyword) {
  5. if (strpos($query, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. // Additional check: ensure it's not just internal comparison
  7. // If query contains "database" or "internal", it's likely hybrid, not pure web_search
  8. if (strpos($query, 'database') === false && strpos($query, 'internal') === false) {
  9. $analysis['intent_type'] = 'web_search';
  10. $analysis['confidence'] = 0.90;
  • gyakutsuki

    not included
  1. if ($hasPriceKeyword) {
  2. foreach (WebSearchPatterns::$comparisonKeywords as $keyword) {
  3. if (strpos($query, $keyword) !== false) {
  4. // Additional check: ensure it's not just internal comparison
  5. // If query contains "database" or "internal", it's likely hybrid, not pure web_search
  6. if (strpos($query, 'database') === false && strpos($query, 'internal') === false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. $analysis['intent_type'] = 'web_search';
  8. $analysis['confidence'] = 0.90;
  9. $analysis['override_reason'] = "Price comparison detected: $keyword";
  10. $analysis['detection_method'] = 'pattern_post_filter';
  11. return $analysis;
  • gyakutsuki

    not included
  1. return self::PRICING[$model];
  2. }
  3. // Match partiel (ex: "gpt-4-0613" match "gpt-4")
  4. foreach (self::PRICING as $knownModel => $pricing) {
  5. if (strpos($model, $knownModel) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $pricing;
  7. }
  8. }
  9. // Détection par provider
  • gyakutsuki

    not included
  1. return $pricing;
  2. }
  3. }
  4. // Détection par provider
  5. if (strpos($model, 'gpt') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return self::PRICING['gpt-3.5-turbo']; // Défaut OpenAI
  7. }
  8. if (strpos($model, 'claude') !== false) {
  9. return self::PRICING['claude-3-haiku']; // Défaut Anthropic (le moins cher)
  10. }
  • gyakutsuki

    not included
  1. // Détection par provider
  2. if (strpos($model, 'gpt') !== false) {
  3. return self::PRICING['gpt-3.5-turbo']; // Défaut OpenAI
  4. }
  5. if (strpos($model, 'claude') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return self::PRICING['claude-3-haiku']; // Défaut Anthropic (le moins cher)
  7. }
  8. if (strpos($model, 'mistral') !== false) {
  9. return self::PRICING['mistral-small']; // Défaut Mistral
  10. }
  • gyakutsuki

    not included
  1. return self::PRICING['gpt-3.5-turbo']; // Défaut OpenAI
  2. }
  3. if (strpos($model, 'claude') !== false) {
  4. return self::PRICING['claude-3-haiku']; // Défaut Anthropic (le moins cher)
  5. }
  6. if (strpos($model, 'mistral') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return self::PRICING['mistral-small']; // Défaut Mistral
  8. }
  9. if (strpos($model, 'llama') !== false || strpos($model, 'ollama') !== false) {
  10. return [0.0, 0.0]; // Local, gratuit
  11. }
  • gyakutsuki

    not included
  1. return self::PRICING['claude-3-haiku']; // Défaut Anthropic (le moins cher)
  2. }
  3. if (strpos($model, 'mistral') !== false) {
  4. return self::PRICING['mistral-small']; // Défaut Mistral
  5. }
  6. if (strpos($model, 'llama') !== false || strpos($model, 'ollama') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return [0.0, 0.0]; // Local, gratuit
  8. }
  9. return null;
  10. }
  • gyakutsuki

    not included
  1. $metrics = array_merge($metrics, $componentStats);
  2. }
  3. // Méthodes spécifiques par type de composant
  4. switch (true) {
  5. case strpos($name, 'Planner') !== false:
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $metrics['type'] = 'planner';
  7. $metrics['total_plans'] = $componentStats['total_plans_created'] ?? 0;
  8. $metrics['avg_steps'] = $componentStats['avg_steps_per_plan'] ?? 0;
  9. break;
  • gyakutsuki

    not included
  1. $metrics['type'] = 'planner';
  2. $metrics['total_plans'] = $componentStats['total_plans_created'] ?? 0;
  3. $metrics['avg_steps'] = $componentStats['avg_steps_per_plan'] ?? 0;
  4. break;
  5. case strpos($name, 'Memory') !== false:
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $metrics['type'] = 'memory';
  7. if (method_exists($component, 'getStats')) {
  8. $memStats = $component->getStats();
  9. $metrics['total_interactions'] = $memStats['total_interactions'] ?? 0;
  10. $metrics['memory_size'] = $memStats['total_size'] ?? 0;
  • gyakutsuki

    not included
  1. $metrics['total_interactions'] = $memStats['total_interactions'] ?? 0;
  2. $metrics['memory_size'] = $memStats['total_size'] ?? 0;
  3. }
  4. break;
  5. case strpos($name, 'Correction') !== false:
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $metrics['type'] = 'correction';
  7. if (method_exists($component, 'getLearningStats')) {
  8. $learnStats = $component->getLearningStats();
  9. $metrics['correction_accuracy'] = $learnStats['correction_accuracy'] ?? 0;
  10. $metrics['learned_patterns'] = $learnStats['learned_patterns'] ?? 0;
  • gyakutsuki

    not included
  1. $metrics['correction_accuracy'] = $learnStats['correction_accuracy'] ?? 0;
  2. $metrics['learned_patterns'] = $learnStats['learned_patterns'] ?? 0;
  3. }
  4. break;
  5. case strpos($name, 'WebSearch') !== false:
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $metrics['type'] = 'web_search';
  7. $metrics['cache_hit_rate'] = $this->extractCacheHitRate($componentStats);
  8. break;
  9. }
  • gyakutsuki

    not included
  1. if ($serverVersion) {
  2. $serverVersionLower = strtolower($serverVersion);
  3. // Extraire et formater correctement la version
  4. if (strpos($serverVersionLower, 'mariadb') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. // Format typique: "10.11.8-MariaDB" ou "11.7.0-mariadb"
  6. preg_match('/(\d+\.\d+\.\d+)/', $serverVersion, $matches);
  7. if (!empty($matches[1])) {
  8. $versionNumber = $matches[1];
  • gyakutsuki

    not included
  1. return true;
  2. }
  3. // Fuzzy match
  4. foreach ($allFields as $field) {
  5. if (strpos($field, $word) !== false || strpos($word, $field) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. // Check against non-database words
  • gyakutsuki

    not included
  1. if (in_array($fieldName, $skipFields, true)) {
  2. return null;
  3. }
  4. // Remove _id suffix for non-ID fields
  5. if ($fieldName !== 'id' && preg_match('/_id$/', $fieldName)) {
    Consider replacing preg_match() with str_ends_with() for improved readability.
    Last edited by clicshopping
  6. return null;
  7. }
  8. return $fieldName;
  9. }
  • gyakutsuki

    not included
  1. if (self::$prefixDb === null) {
  2. self::$prefixDb = CLICSHOPPING::getConfig('db_table_prefix');
  3. }
  4. // Add prefix if not already present
  5. if (strpos($tableName, self::$prefixDb) !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $tableName = self::$prefixDb . $tableName;
  7. }
  8. $connection = self::getEntityManager()->getConnection();
  9. $affectedRows = $connection->insert($tableName, $data);
  • gyakutsuki

    not included
  1. if (self::$prefixDb === null) {
  2. self::$prefixDb = CLICSHOPPING::getConfig('db_table_prefix');
  3. }
  4. // Add prefix if not already present
  5. if (strpos($tableName, self::$prefixDb) !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $tableName = self::$prefixDb . $tableName;
  7. }
  8. $connection = self::getEntityManager()->getConnection();
  9. return $connection->update($tableName, $data, $criteria);
  • gyakutsuki

    not included
  1. if (self::$prefixDb === null) {
  2. self::$prefixDb = CLICSHOPPING::getConfig('db_table_prefix');
  3. }
  4. // Add prefix if not already present
  5. if (strpos($tableName, self::$prefixDb) !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $tableName = self::$prefixDb . $tableName;
  7. }
  8. $connection = self::getEntityManager()->getConnection();
  9. return $connection->delete($tableName, $criteria);
  • gyakutsuki

    not included
  1. error_log("text_order_calculation length: " . strlen($orderCalculation) . " chars");
  2. error_log("text_query_examples length: " . strlen($queryExamples) . " chars");
  3. error_log("sqlFormatInstructions length: " . strlen($sqlFormatInstructions) . " chars");
  4. error_log("text_response_format length: " . strlen($responseFormat) . " chars");
  5. error_log("text_multi_token_rules length: " . strlen($multiTokenRules) . " chars");
  6. error_log("Contains 'MULTI-TOKEN' in multiTokenRules: " . (strpos($multiTokenRules, 'MULTI-TOKEN') !== false ? 'YES' : 'NO'));
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. error_log("Contains 'ABSOLUTE RULE' in aggregationRules: " . (strpos($aggregationRules, 'ABSOLUTE RULE') !== false ? 'YES' : 'NO'));
  8. error_log("First 200 chars of multiTokenRules: " . substr($multiTokenRules, 0, 200));
  9. error_log("================================================================================");
  10. }
  • gyakutsuki

    not included
  1. error_log("text_query_examples length: " . strlen($queryExamples) . " chars");
  2. error_log("sqlFormatInstructions length: " . strlen($sqlFormatInstructions) . " chars");
  3. error_log("text_response_format length: " . strlen($responseFormat) . " chars");
  4. error_log("text_multi_token_rules length: " . strlen($multiTokenRules) . " chars");
  5. error_log("Contains 'MULTI-TOKEN' in multiTokenRules: " . (strpos($multiTokenRules, 'MULTI-TOKEN') !== false ? 'YES' : 'NO'));
  6. error_log("Contains 'ABSOLUTE RULE' in aggregationRules: " . (strpos($aggregationRules, 'ABSOLUTE RULE') !== false ? 'YES' : 'NO'));
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. error_log("First 200 chars of multiTokenRules: " . substr($multiTokenRules, 0, 200));
  8. error_log("================================================================================");
  9. }
  10. // Construct complete message in the correct order
  • gyakutsuki

    not included
  1. error_log("================================================================================");
  2. error_log("DEBUG PromptBuilder::buildSystemMessage() - FINAL");
  3. error_log("================================================================================");
  4. error_log("Language ID: " . $this->languageId);
  5. error_log("Final message length: " . strlen($finalMessage));
  6. error_log("Contains 'CRITICAL RULES': " . (strpos($finalMessage, 'CRITICAL RULES') !== false ? 'YES' : 'NO'));
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. error_log("Contains 'products_quantity': " . (strpos($finalMessage, 'products_quantity') !== false ? 'YES' : 'NO'));
  8. error_log("First 500 chars: " . substr($finalMessage, 0, 500));
  9. error_log("================================================================================");
  10. }
  • gyakutsuki

    not included
  1. error_log("DEBUG PromptBuilder::buildSystemMessage() - FINAL");
  2. error_log("================================================================================");
  3. error_log("Language ID: " . $this->languageId);
  4. error_log("Final message length: " . strlen($finalMessage));
  5. error_log("Contains 'CRITICAL RULES': " . (strpos($finalMessage, 'CRITICAL RULES') !== false ? 'YES' : 'NO'));
  6. error_log("Contains 'products_quantity': " . (strpos($finalMessage, 'products_quantity') !== false ? 'YES' : 'NO'));
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. error_log("First 500 chars: " . substr($finalMessage, 0, 500));
  8. error_log("================================================================================");
  9. }
  10. return $finalMessage;
  • gyakutsuki

    not included
  1. while ($tableRow = $tablesResult->fetch()) {
  2. $tableName = array_values($tableRow)[0];
  3. // Skip non-clic tables
  4. if (strpos($tableName, 'clic_') !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  5. continue;
  6. }
  7. $schema .= "Table: {$tableName}\n";
  • gyakutsuki

    not included
  1. }
  2. }
  3. foreach ($tablesList as $tableName) {
  4. // Skip technical tables
  5. if (strpos($tableName, '_embedding') !== false || strpos($tableName, $prefix . 'rag_') === 0) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. continue;
  7. }
  8. $this->totalTables++;
  • gyakutsuki

    not included
  1. }
  2. }
  3. foreach ($tablesList as $tableName) {
  4. // Skip technical tables
  5. if (strpos($tableName, '_embedding') !== false || strpos($tableName, $prefix . 'rag_') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. continue;
  7. }
  8. $this->totalTables++;
  • gyakutsuki

    not included
  1. while ($Qembeddings->fetch()) {
  2. $tableName = $Qembeddings->value('table_name');
  3. // Skip technical tables (should not be in embeddings, but filter just in case)
  4. if (strpos($tableName, '_embedding') !== false || strpos($tableName, 'clic_rag_') === 0) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. continue;
  6. }
  7. $embeddingText = $Qembeddings->value('embedding_text');
  • gyakutsuki

    not included
  1. while ($Qembeddings->fetch()) {
  2. $tableName = $Qembeddings->value('table_name');
  3. // Skip technical tables (should not be in embeddings, but filter just in case)
  4. if (strpos($tableName, '_embedding') !== false || strpos($tableName, 'clic_rag_') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  5. continue;
  6. }
  7. $embeddingText = $Qembeddings->value('embedding_text');
  • gyakutsuki

    not included
  1. * @param string $tableName Table name
  2. * @return bool True if junction table
  3. */
  4. private function isJunctionTable(string $tableName): bool
  5. {
  6. return preg_match('/_to_/', $tableName) === 1;
    Consider replacing preg_match() with str_contains() for improved readability.
    Last edited by clicshopping
  7. }
  8. /**
  9. * Calculate cosine similarity between two vectors
  10. *
  • gyakutsuki

    not included
  1. public function __construct(EmbeddingGeneratorInterface $embeddingGenerator, string $tableName = 'rag_embeddings')
  2. {
  3. $this->embeddingGenerator = $embeddingGenerator;
  4. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  5. if (!empty($prefix) && strpos($tableName, $prefix) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $this->tableName = $tableName;
  7. } else {
  8. $this->tableName = $prefix . $tableName;
  9. }
  • gyakutsuki

    not included
  1. if (isset($metadata['source_table']) && !empty($metadata['source_table'])) {
  2. $tableName = $metadata['source_table'];
  3. // Remove prefix and _embedding suffix
  4. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  5. if (!empty($prefix) && strpos($tableName, $prefix) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $tableName = substr($tableName, strlen($prefix));
  7. }
  8. $tableName = str_replace('_embedding', '', $tableName);
  9. // Convert to readable format (e.g., "pages_manager_description" -> "Pages Manager Description")
  • gyakutsuki

    not included
  1. // Check if the path is within allowed directories
  2. $isAllowed = false;
  3. foreach ($allowedDirs as $allowedDir) {
  4. $normalizedAllowedDir = str_replace('\\', '/', realpath($allowedDir));
  5. if ($normalizedAllowedDir && strpos($realPath, $normalizedAllowedDir) === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. $isAllowed = true;
  7. break;
  8. }
  9. }
  • gyakutsuki

    not included
  1. * @return bool True if the text contains valid JSON, false otherwise.
  2. */
  3. private static function validateJsonStructure(string $text): bool
  4. {
  5. // Si le texte contient du JSON, vérifier sa validité
  6. if (strpos($text, '{') !== false || strpos($text, '[') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return json_last_error() === JSON_ERROR_NONE;
  8. }
  9. return true; // Pas de JSON détecté
  10. }
  • gyakutsuki

    not included
  1. */
  2. private static function containsMaliciousPatterns(string $text): bool
  3. {
  4. $lowerText = strtolower($text);
  5. foreach (ObfuscationPatterns::$maliciousKeywords as $keyword) {
  6. if (strpos($lowerText, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return true;
  8. }
  9. }
  10. return false;
  • gyakutsuki

    not included
  1. */
  2. private function detectQueryType(string $sql): string
  3. {
  4. $sql = trim(strtoupper($sql));
  5. if (strpos($sql, 'SELECT') === 0) return 'SELECT';
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. if (strpos($sql, 'INSERT') === 0) return 'INSERT';
  7. if (strpos($sql, 'UPDATE') === 0) return 'UPDATE';
  8. if (strpos($sql, 'DELETE') === 0) return 'DELETE';
  9. return 'UNKNOWN';
  • gyakutsuki

    not included
  1. private function detectQueryType(string $sql): string
  2. {
  3. $sql = trim(strtoupper($sql));
  4. if (strpos($sql, 'SELECT') === 0) return 'SELECT';
  5. if (strpos($sql, 'INSERT') === 0) return 'INSERT';
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. if (strpos($sql, 'UPDATE') === 0) return 'UPDATE';
  7. if (strpos($sql, 'DELETE') === 0) return 'DELETE';
  8. return 'UNKNOWN';
  9. }
  • gyakutsuki

    not included
  1. {
  2. $sql = trim(strtoupper($sql));
  3. if (strpos($sql, 'SELECT') === 0) return 'SELECT';
  4. if (strpos($sql, 'INSERT') === 0) return 'INSERT';
  5. if (strpos($sql, 'UPDATE') === 0) return 'UPDATE';
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. if (strpos($sql, 'DELETE') === 0) return 'DELETE';
  7. return 'UNKNOWN';
  8. }
  • gyakutsuki

    not included
  1. $sql = trim(strtoupper($sql));
  2. if (strpos($sql, 'SELECT') === 0) return 'SELECT';
  3. if (strpos($sql, 'INSERT') === 0) return 'INSERT';
  4. if (strpos($sql, 'UPDATE') === 0) return 'UPDATE';
  5. if (strpos($sql, 'DELETE') === 0) return 'DELETE';
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. return 'UNKNOWN';
  7. }
  8. /**
  • gyakutsuki

    not included
  1. {
  2. $query = strtolower($query);
  3. $metrics = self::getMetricsPatterns();
  4. foreach ($metrics as $pattern => $metric) {
  5. if (strpos($query, $pattern) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return $metric;
  7. }
  8. }
  9. return null;
  • gyakutsuki

    not included
  1. public static function hasTimePeriod(string $query): bool
  2. {
  3. $query = strtolower($query);
  4. foreach (self::$timePeriods as $period) {
  5. if (strpos($query, $period) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. return true;
  7. }
  8. }
  9. return false;
  • gyakutsuki

    not included
  1. {
  2. $query = strtolower($query);
  3. $detected = [];
  4. foreach (self::$financialMetrics as $metric) {
  5. if (strpos($query, $metric) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $detected[] = $metric;
  7. }
  8. }
  9. return $detected;
  • gyakutsuki

    not included
  1. {
  2. $query = strtolower($query);
  3. $detected = [];
  4. foreach (self::$timePeriods as $period) {
  5. if (strpos($query, $period) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $detected[] = $period;
  7. }
  8. }
  9. return $detected;
  • gyakutsuki

    not included
  1. $hasConjunction = false;
  2. $conjunctionUsed = '';
  3. foreach ($conjunctions as $conj) {
  4. if (strpos($query, $conj) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. $hasConjunction = true;
  6. $conjunctionUsed = trim($conj);
  7. break;
  8. }
  9. }
  • gyakutsuki

    not included
  1. $part = trim($part);
  2. $partIntent = null;
  3. // Check analytics
  4. foreach ($analyticsKeywords as $keyword) {
  5. if (strpos($part, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $partIntent = 'analytics';
  7. break;
  8. }
  9. }
  • gyakutsuki

    not included
  1. }
  2. // Check semantic
  3. if ($partIntent === null) {
  4. foreach ($semanticKeywords as $keyword) {
  5. if (strpos($part, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $partIntent = 'semantic';
  7. break;
  8. }
  9. }
  10. }
  • gyakutsuki

    not included
  1. }
  2. // Check web_search
  3. if ($partIntent === null) {
  4. foreach ($webSearchKeywords as $keyword) {
  5. if (strpos($part, $keyword) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $partIntent = 'web_search';
  7. break;
  8. }
  9. }
  10. }
  • gyakutsuki

    not included
  1. // Simple routing
  2. // --------------------------------------------------------------------------------
  3. // POST /agentic_commerce/delegate_payment - Handle delegated payment vaulting
  4. // --------------------------------------------------------------------------------
  5. if ($method === 'POST' && ($hasDelegatePaymentParam || strpos($path, '/agentic_commerce/delegate_payment') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $headers = [
  7. 'idempotency_key' => $_SERVER['HTTP_IDEMPOTENCY_KEY'] ?? null,
  8. 'request_id' => $_SERVER['HTTP_REQUEST_ID'] ?? null
  9. ];
  10. $result = $CLICSHOPPING_getRetailers->handleDelegatePayment($input, $headers);
  • gyakutsuki

    not included
  1. // --------------------------------------------------------------------------------
  2. // GET /products - Returns product catalog
  3. // --------------------------------------------------------------------------------
  4. if ($method === 'GET' && ($hasProductsParam || strpos($path, '/products') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  5. // Return full product catalog
  6. $products = $CLICSHOPPING_getRetailers->getProducts();
  7. echo json_encode(['products' => $products], JSON_UNESCAPED_SLASHES);
  8. exit;
  • gyakutsuki

    not included
  1. } elseif (!empty($checkoutIdParam)) {
  2. // Fallback ou prise en compte du paramètre 'id' si l'ID n'est pas dans le chemin
  3. $sessionId = $checkoutIdParam;
  4. }
  5. if ($method === 'POST' && ($hasCheckoutParam || strpos($path, '/checkout_sessions') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. if ($sessionId) {
  7. if ($hasCompleteParam || strpos($path, '/complete') !== false) {
  8. $validation = $CLICSHOPPING_getRetailers->validateAcpInput($input, 'complete', $input['items'] ?? []);
  9. if (!empty($validation)) {
  10. http_response_code(400);
  • gyakutsuki

    not included
  1. $sessionId = $checkoutIdParam;
  2. }
  3. if ($method === 'POST' && ($hasCheckoutParam || strpos($path, '/checkout_sessions') !== false)) {
  4. if ($sessionId) {
  5. if ($hasCompleteParam || strpos($path, '/complete') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $validation = $CLICSHOPPING_getRetailers->validateAcpInput($input, 'complete', $input['items'] ?? []);
  7. if (!empty($validation)) {
  8. http_response_code(400);
  9. echo json_encode(['messages' => $validation], JSON_UNESCAPED_SLASHES);
  10. exit;
  • gyakutsuki

    not included
  1. echo json_encode($result['checkout_session'], JSON_UNESCAPED_SLASHES);
  2. } else {
  3. echo json_encode($result, JSON_UNESCAPED_SLASHES);
  4. }
  5. }
  6. } elseif ($hasCancelParam || strpos($path, '/cancel') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. $result = $CLICSHOPPING_getRetailers->cancelSession($sessionId);
  8. if ($result === null) {
  9. http_response_code(404);
  10. echo json_encode(['error' => 'Session not found']);
  11. } else {
  • gyakutsuki

    not included
  1. exit;
  2. }
  3. // --------------------------------------------------------------------------------
  4. // POST /stripe_webhook - Handle Stripe webhooks
  5. // --------------------------------------------------------------------------------
  6. if ($method === 'POST' && ($hasStripeWebhookParam || strpos($path, '/stripe_webhook') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. $CLICSHOPPING_getRetailers->handleStripeWebhook();
  8. exit;
  9. }
  10. // --------------------------------------------------------------------------------
  • gyakutsuki

    not included
  1. // POST /create_order - Create ClicShopping order from session
  2. // --------------------------------------------------------------------------------
  3. $hasCreateOrderParam = isset($_GET['create_order']);
  4. $orderSessionIdParam = isset($_GET['session_id']) ? (string)$_GET['session_id'] : null;
  5. if ($method === 'POST' && ($hasCreateOrderParam || strpos($path, '/create_order') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. if (empty($orderSessionIdParam)) {
  7. http_response_code(400);
  8. echo json_encode(['error' => 'Session ID required']);
  9. exit;
  10. }
  • gyakutsuki

    not included
  1. // POST /complete_and_order - Complete session then create order
  2. // --------------------------------------------------------------------------------
  3. $hasCompleteAndOrderParam = isset($_GET['complete_and_order']);
  4. $completeSessionIdParam = isset($_GET['session_id']) ? (string)$_GET['session_id'] : null;
  5. if ($method === 'POST' && ($hasCompleteAndOrderParam || strpos($path, '/complete_and_order') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. if (empty($completeSessionIdParam)) {
  7. http_response_code(400);
  8. echo json_encode(['error' => 'Session ID required']);
  9. exit;
  10. }
  • gyakutsuki

    not included
  1. $hasCheckoutParam = isset($_GET['checkout_sessions']) || isset($_GET['retailers/checkout_sessions']);
  2. $checkoutIdParam = isset($_GET['id']) ? (string)$_GET['id'] : null;
  3. $hasCompleteParam = isset($_GET['complete']);
  4. $hasWebhookParam = isset($_GET['webhook']);
  5. if ($method === 'GET' && ($hasProductsParam || strpos($path, '/products') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $filters = [
  7. 'page' => $_GET['page'] ?? 1,
  8. 'limit' => $_GET['limit'] ?? 100,
  9. 'category' => $_GET['category'] ?? null,
  10. 'min_price' => $_GET['min_price'] ?? null,
  • gyakutsuki

    not included
  1. 'action' => 'products'
  2. ]);
  3. exit;
  4. }
  5. if ($method === 'POST' && ($hasCheckoutParam || strpos($path, '/checkout_sessions') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. if (($hasCompleteParam || strpos($path, '/complete') !== false) && (($checkoutIdParam !== null) || preg_match('#/checkout_sessions/([^/]+)/complete#', $path, $matches))) {
  7. $sessionId = $checkoutIdParam ?? $matches[1] ?? null;
  8. if (!$sessionId) {
  9. $errorResponse('VALIDATION_ERROR', 'Missing session id');
  10. }
  • gyakutsuki

    not included
  1. ]);
  2. exit;
  3. }
  4. if ($method === 'POST' && ($hasCheckoutParam || strpos($path, '/checkout_sessions') !== false)) {
  5. if (($hasCompleteParam || strpos($path, '/complete') !== false) && (($checkoutIdParam !== null) || preg_match('#/checkout_sessions/([^/]+)/complete#', $path, $matches))) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $sessionId = $checkoutIdParam ?? $matches[1] ?? null;
  7. if (!$sessionId) {
  8. $errorResponse('VALIDATION_ERROR', 'Missing session id');
  9. }
  10. $result = $ucp->completeSession($sessionId, $input);
  • gyakutsuki

    not included
  1. 'action' => 'checkout_sessions.update'
  2. ]);
  3. exit;
  4. }
  5. if ($method === 'POST' && ($hasWebhookParam || strpos($path, '/webhook') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. $result = $ucp->handleWebhook($input);
  7. echo json_encode($result, JSON_UNESCAPED_SLASHES);
  8. $logger->info('UCP response', [
  9. 'request_id' => $requestId,
  10. 'status' => 200,
  • gyakutsuki

    not included
  1. * @return bool True if it contains a comparison operator, false otherwise.
  2. */
  3. private function isComparisonClause(string $clause): bool
  4. {
  5. foreach (self::ALLOWED_OPERATORS as $operator) {
  6. if (strpos($clause, $operator) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. return true;
  8. }
  9. }
  10. return false;
  11. }
  • gyakutsuki

    not included
  1. while ($Qconfiguration->fetch()) {
  2. if ($Qconfiguration->hasValue('use_function') && !\is_null($Qconfiguration->value('use_function'))) {
  3. $use_function = $Qconfiguration->value('use_function');
  4. if (preg_match('/->/', $use_function)) {
    Consider replacing preg_match() with str_contains() for improved readability.
    Last edited by ClicShopping
  5. $class_method = explode('->', $use_function);
  6. if (!\is_object($class_method[0])) {
  7. include_once('Core/classes/' . $class_method[0] . '.php');
  8. ${$class_method[0]} = new $class_method[0]();
  • gyakutsuki

    not included
  1. // Register shutdown function to handle timeout gracefully
  2. register_shutdown_function(function() use ($seconds) {
  3. $error = error_get_last();
  4. if ($error && ($error['type'] === E_ERROR || $error['type'] === E_USER_ERROR)) {
  5. if (strpos($error['message'], 'Maximum execution time') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. error_log('[INFO : TIME] TIMEOUT ERROR: Query exceeded ' . $seconds . ' seconds');
  7. if (ob_get_length()) ob_clean();
  8. header('Content-Type: application/json; charset=UTF-8');
  • gyakutsuki

    not included
  1. define('CLICSHOPPING_APP_CHATGPT_CH_MODEL', 'gpt-5-mini');
  2. }
  3. $model = $engine ?? CLICSHOPPING_APP_CHATGPT_CH_MODEL;
  4. if (strpos($model, 'gpt') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  5. $maxtoken = self::getMaxTokens($maxtoken);
  6. $temperature = $temperature ?? (float)CLICSHOPPING_APP_CHATGPT_CH_TEMPERATURE;
  7. $tokenParams = ModelManager::getModelApiParameters($model, $maxtoken);
  • gyakutsuki

    not included
  1. if ($engine !== null) {
  2. $parameters['model'] = $engine;
  3. }
  4. $client = ProviderManager::getOpenAiGpt($parameters);
  5. } elseif (strpos($model, 'anth') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $client = ProviderManager::getAnthropicChat($model, $maxtoken);
  7. } elseif (strpos($model, 'mistral') === 0) {
  8. $client = ProviderManager::getMistralChat($model, $maxtoken);
  9. } elseif (strpos($model, 'ollama') === 0 || str_contains($model, ':latest')) {
  10. $client = ProviderManager::getOllamaChat($model);
  • gyakutsuki

    not included
  1. }
  2. $client = ProviderManager::getOpenAiGpt($parameters);
  3. } elseif (strpos($model, 'anth') === 0) {
  4. $client = ProviderManager::getAnthropicChat($model, $maxtoken);
  5. } elseif (strpos($model, 'mistral') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $client = ProviderManager::getMistralChat($model, $maxtoken);
  7. } elseif (strpos($model, 'ollama') === 0 || str_contains($model, ':latest')) {
  8. $client = ProviderManager::getOllamaChat($model);
  9. } elseif (strpos($model, 'openai/') === 0) {
  10. $client = ProviderManager::getLmStudioChat($model);
  • gyakutsuki

    not included
  1. $client = ProviderManager::getOpenAiGpt($parameters);
  2. } elseif (strpos($model, 'anth') === 0) {
  3. $client = ProviderManager::getAnthropicChat($model, $maxtoken);
  4. } elseif (strpos($model, 'mistral') === 0) {
  5. $client = ProviderManager::getMistralChat($model, $maxtoken);
  6. } elseif (strpos($model, 'ollama') === 0 || str_contains($model, ':latest')) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. $client = ProviderManager::getOllamaChat($model);
  8. } elseif (strpos($model, 'openai/') === 0) {
  9. $client = ProviderManager::getLmStudioChat($model);
  10. } else {
  11. $client = ProviderManager::getLmStudioChat($model);
  • gyakutsuki

    not included
  1. $client = ProviderManager::getAnthropicChat($model, $maxtoken);
  2. } elseif (strpos($model, 'mistral') === 0) {
  3. $client = ProviderManager::getMistralChat($model, $maxtoken);
  4. } elseif (strpos($model, 'ollama') === 0 || str_contains($model, ':latest')) {
  5. $client = ProviderManager::getOllamaChat($model);
  6. } elseif (strpos($model, 'openai/') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. $client = ProviderManager::getLmStudioChat($model);
  8. } else {
  9. $client = ProviderManager::getLmStudioChat($model);
  10. }
  • gyakutsuki

    not included
  1. if (is_null($temperature)) {
  2. $temperature = 0.5;
  3. }
  4. if (strpos(CLICSHOPPING_APP_CHATGPT_CH_MODEL, 'gpt') === 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  5. $engine = CLICSHOPPING_APP_CHATGPT_CH_MODEL;
  6. $response = Gpt::getGptResponse($question, $maxtoken, $temperature, $engine);
  7. } else {
  8. //ollama
  9. $response = Gpt::getGptResponse($question, $maxtoken, $temperature);
  • gyakutsuki

    not included
  1. // Simple routing
  2. // --------------------------------------------------------------------------------
  3. // GET /products - Returns product catalog
  4. // --------------------------------------------------------------------------------
  5. if ($method === 'GET' && ($hasProductsParam || strpos($path, '/products') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. // Return full product catalog
  7. $products = $CLICSHOPPING_getRetailers->getProducts();
  8. echo json_encode(['products' => $products], JSON_UNESCAPED_SLASHES);
  9. exit;
  • gyakutsuki

    not included
  1. } elseif (!empty($checkoutIdParam)) {
  2. // Fallback ou prise en compte du paramètre 'id' si l'ID n'est pas dans le chemin
  3. $sessionId = $checkoutIdParam;
  4. }
  5. if ($method === 'POST' && ($hasCheckoutParam || strpos($path, '/checkout_sessions') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. if ($sessionId) {
  7. // Completion: POST /checkout_sessions/{id}
  8. // Choose Delegated Payment or Stripe based on payload
  9. if (!empty($input['delegated_payment'])) {
  10. $session = $CLICSHOPPING_getRetailers->completeSessionWithDelegatedPayment($sessionId, $input);
  • gyakutsuki

    not included
  1. exit;
  2. }
  3. // --------------------------------------------------------------------------------
  4. // POST /stripe_webhook - Handle Stripe webhooks
  5. // --------------------------------------------------------------------------------
  6. if ($method === 'POST' && ($hasStripeWebhookParam || strpos($path, '/stripe_webhook') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  7. $CLICSHOPPING_getRetailers->handleStripeWebhook();
  8. exit;
  9. }
  10. // --------------------------------------------------------------------------------
  • gyakutsuki

    not included
  1. // POST /create_order - Create ClicShopping order from session
  2. // --------------------------------------------------------------------------------
  3. $hasCreateOrderParam = isset($_GET['create_order']);
  4. $orderSessionIdParam = isset($_GET['session_id']) ? (string)$_GET['session_id'] : null;
  5. if ($method === 'POST' && ($hasCreateOrderParam || strpos($path, '/create_order') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. if (empty($orderSessionIdParam)) {
  7. http_response_code(400);
  8. echo json_encode(['error' => 'Session ID required']);
  9. exit;
  10. }
  • gyakutsuki

    not included
  1. // POST /complete_and_order - Complete session then create order
  2. // --------------------------------------------------------------------------------
  3. $hasCompleteAndOrderParam = isset($_GET['complete_and_order']);
  4. $completeSessionIdParam = isset($_GET['session_id']) ? (string)$_GET['session_id'] : null;
  5. if ($method === 'POST' && ($hasCompleteAndOrderParam || strpos($path, '/complete_and_order') !== false)) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by clicshopping
  6. if (empty($completeSessionIdParam)) {
  7. http_response_code(400);
  8. echo json_encode(['error' => 'Session ID required']);
  9. exit;
  10. }
  • gyakutsuki

    not included
  1. while ($Qconfiguration->fetch()) {
  2. if ($Qconfiguration->hasValue('use_function') && !\is_null($Qconfiguration->value('use_function'))) {
  3. $use_function = $Qconfiguration->value('use_function');
  4. if (preg_match('/->/', $use_function)) {
    Consider replacing preg_match() with str_contains() for improved readability.
    Last edited by ClicShopping
  5. $class_method = explode('->', $use_function);
  6. if (!\is_object($class_method[0])) {
  7. include_once('Core/classes/' . $class_method[0] . '.php');
  8. $class_method[0] = new $class_method[0]();
  • gyakutsuki

    not included
  1. $module_active = $modules_payment;
  2. $include_modules = [];
  3. foreach ($modules_payment as $value) {
  4. if (strpos($value, '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  5. $class = Apps::getModuleClass($value, 'Payment');
  6. $include_modules[] = ['class' => $value,
  7. 'file' => $class
  8. ];
  • gyakutsuki

    not included
  1. ];
  2. }
  3. }
  4. for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
  5. if (strpos($include_modules[$i]['class'], '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. Registry::set('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
  7. $module = Registry::get('Payment_' . str_replace('\\', '_', $include_modules[$i]['class']));
  8. ?>
  9. <div class="row">
  10. <div class="col-md-12">
  • gyakutsuki

    not included
  1. $module_active = $modules_shipping;
  2. $include_modules = [];
  3. foreach ($modules_shipping as $value) {
  4. if (strpos($value, '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  5. $class = Apps::getModuleClass($value, 'Shipping');
  6. $include_modules[] = ['class' => $value,
  7. 'file' => $class
  8. ];
  • gyakutsuki

    not included
  1. ];
  2. }
  3. }
  4. for ($i = 0, $n = \count($include_modules); $i < $n; $i++) {
  5. if (strpos($include_modules[$i]['class'], '\\') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. Registry::set('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']), new $include_modules[$i]['file']);
  7. $module = Registry::get('Shipping_' . str_replace('\\', '_', $include_modules[$i]['class']));
  8. ?>
  9. <div class="row">
  10. <div class="col-md-5">
  • gyakutsuki

    not included
  1. $basePath = CLICSHOPPING::getConfig('dir_root', 'Shop') . $CLICSHOPPING_Template->getDynamicTemplateDirectory() . '/modules/' . $directory_selected . '/content/';
  2. $filePath = realpath($basePath . $filename_selected);
  3. // Sécurité chemin
  4. if ($filePath === false || strpos($filePath, realpath($basePath)) !== 0 || !is_file($filePath)) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  5. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_EditDesign->getDef('error_file_does_not_exist'), 'error');
  6. $CLICSHOPPING_EditDesign->redirect('EditModuleContent&action=directory&directory_html=' . $directory_selected);
  7. return false;
  8. }
  • gyakutsuki

    not included
  1. $lang_dir = $CLICSHOPPING_Language->get('directory');
  2. $basePathLang = CLICSHOPPING::getConfig('dir_root', 'Shop') . $CLICSHOPPING_Template->getDynamicTemplateDirectory() . "/css/{$lang_dir}/{$directory_selected}/";
  3. $basePathFallback = CLICSHOPPING::getConfig('dir_root', 'Shop') . $CLICSHOPPING_Template->getDynamicTemplateDirectory() . "/css/english/{$directory_selected}/";
  4. $filePath = realpath($basePathLang . $filename_selected);
  5. if ($filePath === false || strpos($filePath, realpath($basePathLang)) !== 0 || !is_file($filePath)) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. $filePath = realpath($basePathFallback . $filename_selected);
  7. if ($filePath === false || strpos($filePath, realpath($basePathFallback)) !== 0 || !is_file($filePath)) {
  8. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_EditDesign->getDef('error_file_does_not_exist'), 'error');
  9. $CLICSHOPPING_EditDesign->redirect('EditCss&action=directory&directory_css=' . $directory_selected);
  10. return false;
  • gyakutsuki

    not included
  1. $basePathFallback = CLICSHOPPING::getConfig('dir_root', 'Shop') . $CLICSHOPPING_Template->getDynamicTemplateDirectory() . "/css/english/{$directory_selected}/";
  2. $filePath = realpath($basePathLang . $filename_selected);
  3. if ($filePath === false || strpos($filePath, realpath($basePathLang)) !== 0 || !is_file($filePath)) {
  4. $filePath = realpath($basePathFallback . $filename_selected);
  5. if ($filePath === false || strpos($filePath, realpath($basePathFallback)) !== 0 || !is_file($filePath)) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  6. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_EditDesign->getDef('error_file_does_not_exist'), 'error');
  7. $CLICSHOPPING_EditDesign->redirect('EditCss&action=directory&directory_css=' . $directory_selected);
  8. return false;
  9. }
  10. }
  • gyakutsuki

    not included
  1. $baseDir = CLICSHOPPING::getConfig('dir_root', 'Shop') . $CLICSHOPPING_Template->getDynamicTemplateDirectory() . '/files/';
  2. $filePath = realpath($baseDir . $filename_selected);
  3. // Sécuriser le chemin pour éviter directory traversal
  4. if ($filePath === false || strpos($filePath, realpath($baseDir)) !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  5. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_EditDesign->getDef('error_file_does_not_exist'), 'error');
  6. $CLICSHOPPING_EditDesign->redirect('EditModuleContent&action=directory&directory_html=' . $directory_selected);
  7. return false;
  8. }
  • gyakutsuki

    not included
  1. . $CLICSHOPPING_Template->getDynamicTemplateDirectory()
  2. . '/modules/' . $directory_selected . '/template_html/';
  3. $filePath = realpath($basePath . $filename_selected);
  4. if ($filePath === false || strpos($filePath, realpath($basePath)) !== 0 || !is_file($filePath)) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by ClicShopping
  5. $CLICSHOPPING_MessageStack->add($CLICSHOPPING_EditDesign->getDef('error_file_does_not_exist'), 'error');
  6. $CLICSHOPPING_EditDesign->redirect('EditListing&action=directory&directory_html=' . $directory_selected);
  7. return false;
  8. }
  • gyakutsuki

    not included
  1. $Qcategories->execute();
  2. $categories_array = $Qcategories->fetchAll();
  3. foreach ($categories_array as $cat) {
  4. $catLower = strtolower($cat['categories_name'] ?? '');
  5. if (strpos($translated, $catLower) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. $intent['entities']['category'] = $catLower;
  7. $matchWeight += 0.8;
  8. $totalWeight += 1;
  9. break;
  10. }
  • gyakutsuki

    not included
  1. 'text' => $Qproducts->valueInt('customers_basket_quantity') . ' x ' . $Qproducts->value('products_name')
  2. ];
  3. $attributes = [];
  4. if (strpos($Qproducts->valueInt('products_id'), '{') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  5. $combos = [];
  6. preg_match_all('/(\{[0-9]+\}[0-9]+){1}/', $Qproducts->valueInt('products_id'), $combos);
  7. foreach ($combos[0] as $combo) {
  8. $att = [];
  • gyakutsuki

    not included
  1. 'Connection' => 'close'
  2. ];
  3. if (!empty($parameters['header'])) {
  4. foreach ($parameters['header'] as $header) {
  5. if (strpos($header, ':') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. [$name, $value] = explode(':', $header, 2);
  7. $headers[trim($name)] = trim($value);
  8. }
  9. }
  10. }
  • gyakutsuki

    not included
  1. $headers = ['status_code' => $statusCode];
  2. while (($line = fgets($socket)) !== false) {
  3. $line = trim($line);
  4. if ($line === '') break;
  5. if (strpos($line, ':') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. [$name, $value] = explode(':', $line, 2);
  7. $headers[strtolower(trim($name))] = trim($value);
  8. }
  9. }
  • gyakutsuki

    not included
  1. foreach ($files as $sm) {
  2. $result['file'][] = ['files_name' => $sm];
  3. }
  4. foreach ($result['file'] as &$module) {
  5. if (strpos($module['files_name'], '.') !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. $class = substr($module['files_name'], 0, strrpos($module['files_name'], '.'));
  7. $this->startService($class);
  8. }
  9. }
  10. }
  • gyakutsuki

    not included
  1. $content = file($spiders_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
  2. foreach ($content as $line) {
  3. $line = trim($line);
  4. // Ignore empty lines and comments starting with '#'
  5. if (!empty($line) && strpos($line, '#') !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $spiders_array[] = strtolower($line);
  7. }
  8. }
  9. // Save processed list to cache for future requests
  • gyakutsuki

    not included
  1. $this->logSecurityError("Invalid path detected", $path);
  2. continue;
  3. }
  4. // Ensure the resolved path is still within the root directory
  5. if (strpos($real_path, $root_dir) !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $this->logSecurityError("Path traversal attempt detected", $real_path);
  7. continue;
  8. }
  9. if (is_file($real_path) && is_readable($real_path)) {
  • gyakutsuki

    not included
  1. if ((substr($spider, strlen($spider) - 1, 1) == ' ') || (substr($spider, strlen($spider) - 1, 1) == "\n")) {
  2. $spider = substr($spider, 0, strlen($spider) - 1);
  3. }
  4. if (!empty($spider)) {
  5. if (strpos($user_agent, $spider) !== false) {
    Consider replacing strpos() with str_contains() for improved readability.
    Last edited by ClicShopping
  6. $parameters['can_start'] = false;
  7. break;
  8. }
  9. }
  10. }
  • gyakutsuki

    not included
  1. // Also clear old embedding cache files from root cache directory (excluding embedding_search)
  2. $oldEmbeddingFiles = glob($generalCacheDir . 'embedding_*.cache');
  3. if ($oldEmbeddingFiles) {
  4. // Filter out embedding_search files
  5. $oldEmbeddingFiles = array_filter($oldEmbeddingFiles, function($file) {
  6. return strpos(basename($file), 'embedding_search_') !== 0;
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  7. });
  8. $cleared = 0;
  9. foreach ($oldEmbeddingFiles as $file) {
  10. if (unlink($file)) {
  • gyakutsuki

    not included
  1. $CLICSHOPPING_templateCss->logSecurityError("CSS file not accessible", $cssFile);
  2. continue;
  3. }
  4. // Directory Traversal protection: ensure the file is within the allowed root directory
  5. if (strpos($real_path, $root_dir . DIRECTORY_SEPARATOR) !== 0) {
    Consider replacing strpos() with str_starts_with() for improved readability.
    Last edited by clicshopping
  6. $CLICSHOPPING_templateCss->logSecurityError("CSS file outside allowed directory", $cssFile);
  7. continue;
  8. }
  9. // Check individual file size
  • gyakutsuki

    not included

Your project uses legacy callable syntax instead of first-class callable syntax 30

More information: https://insight.symfony.com/what-we-analyse/php.use_first_class_callable_syntax

New rule! We've recently added this rule to Insight. Don't be surprised to see new suggestions even though the codebase didn't change.
  1. $page = $matches[2];
  2. }
  3. $args[0] = $req_site . DIRECTORY_SEPARATOR . self::getConfig('http_images_path', $req_site) . $page;
  4. $url = forward_static_call_array([static::class, 'link'], $args);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. return $url;
  6. }
  7. /**
  • gyakutsuki

    change but there are false posittive
  1. $page = $matches[2];
  2. }
  3. $args[0] = 'Shop/public/Sites/' . $req_site . DIRECTORY_SEPARATOR . $page;
  4. $url = forward_static_call_array([self::class, 'link'], $args);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. return $url;
  6. }
  7. /**
  • gyakutsuki

    change but there are false posittive
  1. */
  2. public static function redirect(): string
  3. {
  4. $args = func_get_args();
  5. $url = call_user_func_array([self::class, 'link'], $args);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. if ((strstr($url, "\n") !== false) || (strstr($url, "\r") !== false)) {
  7. $url = self::link(null, '', false);
  8. }
  • gyakutsuki

    change but there are false posittive
  1. */
  2. public static function getDef(): string
  3. {
  4. $CLICSHOPPING_Language = Registry::get('Language');
  5. return call_user_func_array([$CLICSHOPPING_Language, 'getDef'], func_get_args());
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. /**
  8. * Checks if the specified route exists by comparing the beginning of the $_GET keys with the given path array.
  9. *
  • gyakutsuki

    change but there are false posittive
  1. $config = [];
  2. foreach ($embeddingTables as $embeddingTable) {
  3. // Extract entity type: clic_products_embedding -> products
  4. $entityType = str_replace([$prefix, '_embedding'], '', $embeddingTable);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  5. $table = $prefix . $entityType;
  6. // Get ID column from EntityRegistry (reuse existing logic)
  7. $idColumn = $entityRegistry->getIdColumnForEntityType($entityType);
  • gyakutsuki

    change but there are false posittive
  1. $config = [];
  2. foreach ($embeddingTables as $embeddingTable) {
  3. // Extract entity type: clic_products_embedding -> products
  4. $entityType = str_replace([$prefix, '_embedding'], '', $embeddingTable);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  5. $table = $prefix . $entityType;
  6. // Get ID column from EntityRegistry (reuse existing logic)
  7. $idColumn = $entityRegistry->getIdColumnForEntityType($entityType);
  • gyakutsuki

    change but there are false posittive
  1. if (isset($cache)) {
  2. if (!is_array($cache)) {
  3. $cache = [$cache];
  4. }
  5. call_user_func_array([$Q, 'setCache'], $cache);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. $Q->execute();
  8. return $Q;
  • gyakutsuki

    change but there are false posittive
  1. $this->read();
  2. }
  3. if (is_array($this->listing) && (count($this->listing) > 0)) {
  4. if ($sort_by_directories === true) {
  5. usort($this->listing, array($this, 'sortListing'));
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. }
  7. return $this->listing;
  8. }
  • gyakutsuki

    change but there are false posittive
  1. if (!isset($args[2])) {
  2. $args[2] = $this->vendor . '-' . $this->code;
  3. }
  4. return call_user_func_array([$this->lang, 'getDef'], $args);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. }
  6. /**
  7. * Checks whether a definitions file exists for the specified group and optionally a language code.
  8. *
  • gyakutsuki

    change but there are false posittive
  1. $this->db = Registry::get('Db');
  2. }
  3. // Register shutdown function to flush buffer
  4. if ($bufferEnabled) {
  5. register_shutdown_function([$this, 'flushBuffer']);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }
  7. $this->stats = new SecurityStatistics();
  8. }
  • gyakutsuki

    change but there are false posittive
  1. return $document;
  2. }
  3. public function embedDocuments(array $documents): array
  4. {
  5. return array_map([$this, 'embedDocument'], $documents);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }
  7. public function getEmbeddingLength(): int
  8. {
  9. return NewVector::getEmbeddingLength();
  • gyakutsuki

    change but there are false posittive
  1. return $document;
  2. }
  3. public function embedDocuments(array $documents): array
  4. {
  5. return array_map([$this, 'embedDocument'], $documents);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. }
  7. public function getEmbeddingLength(): int
  8. {
  9. return NewVector::getEmbeddingLength();
  • gyakutsuki

    change but there are false posittive
  1. // Build a mapping of table names (without prefix) to entity types
  2. $tableToEntityType = [];
  3. foreach ($allTables as $fullTableName) {
  4. $entityType = $registry->getEntityTypeForTable($fullTableName);
  5. // Remove prefix and _embedding suffix to get base table name
  6. $tableName = str_replace([$prefix, '_embedding'], '', $fullTableName);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. $tableToEntityType[$tableName] = $entityType;
  8. }
  9. // Pattern 1: FROM {table_name}
  10. if (preg_match('/FROM\s+(?:\w+\.)?(\w+)/i', $query, $matches)) {
  • gyakutsuki

    change but there are false posittive
  1. }
  2. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  3. // Remove prefix and '_embedding' suffix to get entity type
  4. $entityType = str_replace([$prefix, '_embedding'], '', $tableName);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  5. // Get ID column for this entity type
  6. $idColumn = $this->getIdColumnForEntityType($entityType);
  7. // Cache the result
  • gyakutsuki

    change but there are false posittive
  1. public function getEntityTypeForTable(string $tableName): string
  2. {
  3. $prefix = CLICSHOPPING::getConfig('db_table_prefix');
  4. // Remove prefix and '_embedding' suffix
  5. $entityType = str_replace([$prefix, '_embedding'], '', $tableName);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. return $entityType;
  7. }
  8. /**
  • gyakutsuki

    change but there are false posittive
  1. */
  2. public function invalidateCacheByTables(array $tableNames): int
  3. {
  4. $invalidated = 0;
  5. $cleanTableNames = array_map(
  6. [SQLTableParser::class, 'cleanTableName'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  7. $tableNames
  8. );
  9. // Invalidate from Redis
  10. if ($this->useRedis && $this->redis) {
  • gyakutsuki

    change but there are false posittive
  1. // Extract tables from DELETE FROM
  2. $tables = array_merge($tables, self::extractDeleteTable($normalizedQuery, $upperQuery));
  3. // Remove duplicates and clean table names
  4. $tables = array_unique($tables);
  5. $tables = array_map([self::class, 'cleanTableName'], $tables);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $tables = array_filter($tables); // Remove empty strings
  7. return array_values($tables);
  8. }
  • gyakutsuki

    change but there are false posittive
  1. ($this->onOpen)();
  2. }
  3. try {
  4. // Utilisation du streaming de la nouvelle classe Stream
  5. Stream::executeStreaming($parameters, [$this, 'processStreamData']);
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. } catch (Exception $e) {
  7. throw $e;
  8. } finally {
  9. $this->connected = false;
  • gyakutsuki

    change but there are false posittive
  1. if (class_exists('Memcached')) {
  2. $this->orig_module_name = session_module_name();
  3. session_set_save_handler(
  4. [$this, 'open'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. [$this, 'close'],
  6. [$this, 'read'],
  7. [$this, 'write'],
  8. [$this, 'destroy'],
  9. [$this, 'gc']
  • gyakutsuki

    change but there are false posittive
  1. if (class_exists('Memcached')) {
  2. $this->orig_module_name = session_module_name();
  3. session_set_save_handler(
  4. [$this, 'open'],
  5. [$this, 'close'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. [$this, 'read'],
  7. [$this, 'write'],
  8. [$this, 'destroy'],
  9. [$this, 'gc']
  10. );
  • gyakutsuki

    change but there are false posittive
  1. $this->orig_module_name = session_module_name();
  2. session_set_save_handler(
  3. [$this, 'open'],
  4. [$this, 'close'],
  5. [$this, 'read'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. [$this, 'write'],
  7. [$this, 'destroy'],
  8. [$this, 'gc']
  9. );
  10. }
  • gyakutsuki

    change but there are false posittive
  1. session_set_save_handler(
  2. [$this, 'open'],
  3. [$this, 'close'],
  4. [$this, 'read'],
  5. [$this, 'write'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. [$this, 'destroy'],
  7. [$this, 'gc']
  8. );
  9. }
  10. }
  • gyakutsuki

    change but there are false posittive
  1. session_set_save_handler(
  2. [$this, 'open'],
  3. [$this, 'close'],
  4. [$this, 'read'],
  5. [$this, 'write'],
  6. [$this, 'destroy'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. [$this, 'gc']
  8. );
  9. }
  10. }
  • gyakutsuki

    change but there are false posittive
  1. [$this, 'open'],
  2. [$this, 'close'],
  3. [$this, 'read'],
  4. [$this, 'write'],
  5. [$this, 'destroy'],
  6. [$this, 'gc']
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. );
  8. }
  9. }
  10. /**
  • gyakutsuki

    change but there are false posittive
  1. if (class_exists('\Redis')) {
  2. $this->orig_module_name = session_module_name();
  3. session_set_save_handler(
  4. [$this, 'open'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  5. [$this, 'close'],
  6. [$this, 'read'],
  7. [$this, 'write'],
  8. [$this, 'destroy'],
  9. [$this, 'gc']
  • gyakutsuki

    change but there are false posittive
  1. if (class_exists('\Redis')) {
  2. $this->orig_module_name = session_module_name();
  3. session_set_save_handler(
  4. [$this, 'open'],
  5. [$this, 'close'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. [$this, 'read'],
  7. [$this, 'write'],
  8. [$this, 'destroy'],
  9. [$this, 'gc']
  10. );
  • gyakutsuki

    change but there are false posittive
  1. $this->orig_module_name = session_module_name();
  2. session_set_save_handler(
  3. [$this, 'open'],
  4. [$this, 'close'],
  5. [$this, 'read'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. [$this, 'write'],
  7. [$this, 'destroy'],
  8. [$this, 'gc']
  9. );
  10. }
  • gyakutsuki

    change but there are false posittive
  1. session_set_save_handler(
  2. [$this, 'open'],
  3. [$this, 'close'],
  4. [$this, 'read'],
  5. [$this, 'write'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  6. [$this, 'destroy'],
  7. [$this, 'gc']
  8. );
  9. }
  10. }
  • gyakutsuki

    change but there are false posittive
  1. session_set_save_handler(
  2. [$this, 'open'],
  3. [$this, 'close'],
  4. [$this, 'read'],
  5. [$this, 'write'],
  6. [$this, 'destroy'],
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. [$this, 'gc']
  8. );
  9. }
  10. }
  • gyakutsuki

    change but there are false posittive
  1. [$this, 'open'],
  2. [$this, 'close'],
  3. [$this, 'read'],
  4. [$this, 'write'],
  5. [$this, 'destroy'],
  6. [$this, 'gc']
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by ClicShopping
  7. );
  8. }
  9. }
  10. /**
  • gyakutsuki

    change but there are false posittive