Plugin Directory

Changeset 3094350


Ignore:
Timestamp:
05/29/2024 08:21:31 AM (22 months ago)
Author:
heyrectruit
Message:
  1. 1.2.1
  • Kompatibilität mit neuerer Version der Heyrecruit-API und PHP v.7.4 hergestellt
Location:
heyrecruit/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • heyrecruit/trunk/Controller/HeyrecruitController.php

    r3079466 r3094350  
    1313
    1414    /**
    15      * @var mixed
     15     * @var string|int|bool
    1616     */
    1717    private $pageId;
     
    369369        $form->locationId = $this->job['company_location_jobs'][0]['company_location_id'];
    370370        $form->postUrl = HEYRECRUIT_URL . $this->applyPath . '?language=deu&job_id=' . $form->jobId . '&company_location_id=' . $form->locationId;
    371         $form->jwt = esc_attr($_SESSION['HEYRECRUIT_TOKEN']);
     371        $form->jwt = esc_attr($_SESSION['HEYRECRUIT_TOKEN'] ?? null);
    372372        $form->confirmPage = $this->getOption('confirmPage');
    373373
     
    635635        ob_start();
    636636
     637        $textElement = $this->element['job_section_element_strings'][0]['text'] ?? '';
     638
    637639        if ($this->element['element_type'] === 'image') {
    638             $data = json_decode($this->element['job_section_element_strings'][0]['text']) ?? null;
     640            $data = json_decode($textElement);
    639641
    640642            if (!$data) {
     
    644646            $imageSrc = $data[0];
    645647        } else {
    646             $data = json_decode($this->element['job_section_element_strings'][0]['text']) ?? null;
     648
     649            $data = json_decode($textElement);
    647650        }
    648651
     
    13611364
    13621365                $args = (object)[
    1363                     'showDescription'       => $overviewPage->show_description,
    1364                     'description'           => $overviewPage->overview_page_strings[0]['description'] ?? null,
     1366                    'showDescription' => $overviewPage->show_description,
     1367                    'description'     => $overviewPage->overview_page_strings[0]['description'] ?? null,
    13651368                ];
    13661369            }
     
    13941397            $template = 'companyInfoDeactivated.php';
    13951398            $companyLocation = $company->company_locations[array_key_first($company->company_locations)];
    1396 
    1397 
    13981399
    13991400            if ($overviewPage->show_social_links) {
     
    14271428     * @param bool|null $default
    14281429     *
    1429      * @return null|mixed
     1430     * @return object|resource|array|string|float|int|bool|null
    14301431     */
    14311432    public function getOption(string $name, bool $default = null) {
     
    14381439     *
    14391440     * @param string $name
    1440      * @param mixed|null $value
     1441     * @param object|resource|array|string|float|int|bool|null $value
    14411442     *
    14421443     * @return void
     
    17731774     * emptyCheck
    17741775     *
    1775      * @param mixed $value
     1776     * @param string|null $value
    17761777     *
    17771778     * @return string|bool
    17781779     */
    1779     private function emptyCheck($value): ?string {
     1780    private function emptyCheck(?string $value): ?string {
    17801781
    17811782        return empty($value) ? false : $value;
  • heyrecruit/trunk/Controller/HeyrecruitRestApiController.php

    r3066361 r3094350  
    106106        }
    107107
    108         $this->setAuthConfig();
    109         $this->authenticate();
     108        if (isset($_SESSION['HEYRECRUIT_COMPANY']['id'])
     109            && $_SESSION['HEYRECRUIT_COMPANY']['id'] !== HEYRECRUIT_COMPANY_ID
     110        ) {
     111            unset($_SESSION['HEYRECRUIT_TOKEN']);
     112        }
     113
     114        if (HEYRECRUIT_COMPANY_ID && HEYRECRUIT_API_SECRET_KEY) {
     115
     116            $this->setAuthConfig();
     117            $this->authenticate();
     118        }
    110119    }
    111120
     
    151160        }
    152161
    153         unset($_SESSION['HEYRECRUIT_TOKEN']);
    154162
    155163        return ['error' => true];
     
    174182    public function getCompany(): array {
    175183
    176         if (isset($_SESSION['HEYRECRUIT_COMPANY']) && !HEYRECRUIT_DEBUG_MODUS) {
     184        if (isset($_SESSION['HEYRECRUIT_COMPANY']) &&
     185            ($_SESSION['HEYRECRUIT_COMPANY']['id'] ?? 0) === HEYRECRUIT_COMPANY_ID && !HEYRECRUIT_DEBUG_MODUS) {
     186
     187            unset($_SESSION['HEYRECRUIT_TOKEN']);
    177188            return $_SESSION['HEYRECRUIT_COMPANY'];
    178         }
     189
     190        }
     191
    179192
    180193        $result = $this->curlGet($this->path['get_company'] . '/', null);
     
    334347    protected function addApplicant(int $jobId, int $locationId, array $data): array {
    335348
    336         $url = $this->path['add_applicant'] . '?job_id=' . $jobId . '&company_location_id='. $locationId;
    337 
    338         return  $this->curlPost($url, $data);
     349        $url = $this->path['add_applicant'] . '?job_id=' . $jobId . '&company_location_id=' . $locationId;
     350
     351        return $this->curlPost($url, $data);
    339352    }
    340353
     
    359372     * @param array|null $query
    360373     *
    361      * @return mixed
     374     * @return array
    362375     */
    363376    private function curlGet(string $url, ?array $query = []): array {
     
    366379
    367380        $queryData = http_build_query($query);
    368         $queryData = str_replace(['%5B%5D', '%5B0%5D'], ['[]', ''], $queryData);
     381        $queryData = str_replace([
     382            '%5B%5D',
     383            '%5B0%5D'
     384        ], [
     385            '[]',
     386            ''
     387        ], $queryData);
    369388
    370389        $query = strpos($url, '?') !== false ? '&' . $queryData : '?' . $queryData;
     
    379398     * @param array $data
    380399     *
    381      * @return mixed
    382      */
    383     private function curlPost(string $path, array $data = []): mixed {
     400     * @return array
     401     */
     402    private function curlPost(string $path, array $data = []): array {
    384403
    385404        return $this->sendCurl($path, $data);
     
    393412     * @param string $sendType
    394413     *
    395      * @return mixed
    396      */
    397     private function sendCurl(string $path, array $data, string $sendType = 'POST'): mixed {
     414     * @return array
     415     */
     416    private function sendCurl(string $path, array $data, string $sendType = 'POST'): array {
    398417
    399418        $dataJson = json_encode($data);
  • heyrecruit/trunk/constConfig.php

    r3079470 r3094350  
    33const
    44HEYRECRUIT_PLUGIN_NAME = 'Heyrecruit',
    5 HEYRECRUIT_VERSION = '1.2.0',
     5HEYRECRUIT_VERSION = '1.2.1',
    66HEYRECRUIT_PLUGIN_BASENAME = 'heyrecruit/heyrecruit.php',
    77HEYRECRUIT_OPTION_KEY_NAME = 'heyrecruit',
  • heyrecruit/trunk/heyrecruit.php

    r3079470 r3094350  
    1010
    1111/**
    12  * @since             1.2.0
     12 * @since             1.2.1
    1313 * @package           heyrecruit_core
    1414 * @wordpress-plugin
    1515 * Plugin Name:       Heyrecruit
    16  * Version:           1.2.0
     16 * Version:           1.2.1
    1717 * Author:            Heyrecruit
    1818 * Author URI:        https://www.heyrecruit.de
  • heyrecruit/trunk/readme.txt

    r3079466 r3094350  
    22Contributors: heyrecruit
    33Requires at least: 6.1.1
    4 Tested up to: 6.5.2
     4Tested up to: 6.5.3
    55Requires PHP: 7.4
    6 Stable tag: 1.2.0
     6Stable tag: 1.2.1
    77License: GPLv2
    88
     
    7878
    7979== Changelog ==
     80= 1.2.1 =
     81*Kompatibilität mit neuerer Version der Heyrecruit-API und PHP v.7.4 hergestellt
     82
     83== Changelog ==
    8084= 1.2.0 =
    81 *Aufschlüsselung des Shortcodes **[hr_company_info]** in **[hr_company_header]** & **[hr_company_description]** für eine noch individuellere Gestaltung.
     85*Aufschlüsselung des Shortcodes **[hr_company_info]** in +*[hr_company_header]** & **[hr_company_description]** für eine noch individuellere Gestaltung.
    8286*Aufsplittung des Job Headers in die Anzeigen-Details und Anzeigentitel, Anzeigensubtitel und Anzeigenbild.
    8387*Kopfzeile wird nun mit und ohne Bild zur Verfügung gestellt.
  • heyrecruit/trunk/templates/sections/text.php

    r3066361 r3094350  
    11<?php defined('ABSPATH') || exit; ?>
    22<span class="hr_text"
    3       style="display: block;"><?php echo wp_kses_post($this->element['job_section_element_strings'][0]['html']) ?? wp_kses_post($this->element['job_section_element_strings'][0]['text']); ?></span>
     3      style="display: block;"><?php echo wp_kses_post($this->element['job_section_element_strings'][0]['html']??'') ?? wp_kses_post($this->element['job_section_element_strings'][0]['text']??''); ?></span>
Note: See TracChangeset for help on using the changeset viewer.