1. GSManager
    1. Funktionen
    2. Unterstützte Spiele
    3. Neuigkeiten
    4. Statistiken
    5. Serverliste
  2. Lexikon
  3. Filebase
  4. Entwicklung
  5. Forum
    1. Dashboard
    2. Unerledigte Themen
  6. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Seiten
  • Dateien
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. GSManager
  2. Forum
  3. Allgemeines
  4. Fehler

Bug found in mod.class.php function FindMap

  • DFC-NightMare[NL]
  • 23. Juli 2009 um 18:02
Das Projekt GSManager (vormals ManuAdminMod) wurde am 01.01.2020 eingestellt - diese Internetpräsenz bleibt verfügbar, die Software wird aber nicht länger gepflegt. Vielen Dank für eure Unterstützung in den mehr als zehn vergangenen Jahren!
1. offizieller Beitrag
  • DFC-NightMare[NL]
    Anfänger
    Punkte
    20
    Beiträge
    2
    • 23. Juli 2009 um 18:02
    • #1

    Hi Guys,


    I think I found a bug in the function FindMap.

    When we use "!setnextmap mapname" with a mapname that doesnt exist the server (cod5) crashes when rotating to that new map.

    After looking at the code i found an easy fix:


    old code:

    public function findMap($search) {
    $search = strtolower($search);
    if (array_key_exists($search, $this->maps)) {
    return $search;
    }
    foreach ($this->maps as $short => $long) {
    if (strtolower($long) == $search) {
    return $short;
    }
    }
    if (!preg_match('|^[a-z0-9._-]+$|i', $search)) return false;
    return $search;
    }


    New code:

    public function findMap($search) {
    $search = strtolower($search);
    if (array_key_exists($search, $this->maps)) {
    return $search;
    }
    foreach ($this->maps as $short => $long) {
    if (strtolower($long) == $search) {
    return $short;
    }
    }
    if (!preg_match('|^[a-z0-9._-]+$|i', $search)) return false;
    return false;
    }

    Changes: last line returns false instead of ($search), the mapname.

    This causes the admin mod to say "no such map" when typing a wrong mapname.

    And therefor the server no longer crashes.
    running standard cod5.


    Please update this in the next package.

    And keep up the good work!


    DFC-NightMare[NL]

    http://www.dutchfightclub.nl

    Einmal editiert, zuletzt von DFC-NightMare[NL] (23. Juli 2009 um 18:07)

  • Dennis
    Administrator
    Reaktionen
    148
    Punkte
    37.918
    Trophäen
    7
    Artikel
    4
    Dateien
    1
    Beiträge
    7.454
    • 24. Juli 2009 um 06:13
    • Offizieller Beitrag
    • #2

    Very Great Thing! My Admins often make Typos in MapNames and then the Server crashes. Nice done!

  • manu
    Meister
    Punkte
    10.835
    Trophäen
    3
    Beiträge
    2.113
    • 24. Juli 2009 um 12:07
    • #3

    Thank you, will try to fix this :D

  1. Mitarbeiter
  2. Datenschutzerklärung
  3. Nutzungsbedingungen
  4. Impressum
  5. Kontakt
Community-Software: WoltLab Suite™