php - Error in conditional statement -
i have following text in file settings.php :
etc... //ustawienia podstawowe define("p2_page_closed", "true"); // przerwa techniczna - prawidłowe wartości = true lub false define("p2_page_clstxt", "przepraszamy za utrudnienia - strona tymczasowo nieczynna"); //opis wyświetlany w przypadku przerwy technicznej define("p2_page_bgcolor", ""); //inny niż biały kolor tła - należy zapisać w postaci heksadecymalnej (musi zawierać # !) define("p2_page_title", "portal uczniowski 2.0 - {title}"); // tytuł strony - {title} = nazwa aktualnie przeglądanej strony define("p2_page_index", "true"); // czy strona ma być indeksowna przez wyszukiwarki internetowe - prawidłowe wartości = true lub false define("p2_page_keywords","portal uczniowski 2.0"); // słowa kluczowe dla wyszukiwarki - może pozostać puste w przypadku gdy wartość pola p2_page_index jest równa false define("p2_page_desc","portal uczniowski"); // opis strony w wyszukiwarce - - może pozostać puste w przypadku gdy wartość pola p2_page_index jest równa false define("p2_page_onlyreg", "true"); //tylko zarejstrowani użytkownicy mogą odwiedzić stronę - prawidłowe wartości = true lub false // etc... i have got function (in file core.inc), validates correctness of settings.php :
function core_validatesettings() { include_once("settings.php"); if(p2_page_closed != "false" && p2_page_closed != "true") { echo "błąd w stałej ustawień p2_page_closed"; return false;} if(p2_page_index != "false" && p2_page_index != "true") { echo "błąd w stałej ustawień p2_page_index"; return false;} if(p2_page_onlyreg != "false" && p2_page_onlyreg != "true") { echo "błąd w stałej ustawień p2_page_onlyreg"; return false;} if(p2_sec_hotlink != "false" && p2_sec_hotlink != "true") { echo "błąd w stałej ustawień p2_sec_hotlink"; return false;} if(p2_sec_reqmail != "false" && p2_sec_reqmail != "true") { echo "błąd w stałej ustawień p2_sec_reqmail"; return false;} if(p2_sec_recpass != "false" && p2_sec_recpass != "true") { echo "błąd w stałej ustawień p2_sec_recpass"; return false;} if(!is_int(p2_sec_minpass)) { echo "błąd w stałej ustawień p2_sec_minpass"; return false;} if(!is_int(p2_sec_maxpass)) { echo "błąd w stałej ustawień p2_sec_maxpass"; return false;} if(!is_int(p2_sec_flogin)) { echo "błąd w stałej ustawień p2_sec_flogin"; return false;} return true; } i don't know why, result of program (in index.php have function implemented)
"błąd w stałej ustawień p2_page_closed"
is there error in conditional statements ? should display nothing ! analyzed code 3 times, didn't see anything.
because first condition evaluating true, can logically assume p2_page_closed != "true" evaluating true, means there must issue include_once method causing define calls not executed (assuming there no issues if statements).
also, might helpful turn on php's more verbose error handling.
Comments
Post a Comment