![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 697 Pomógł: 47 Dołączył: 19.12.2003 Skąd: Lublin Ostrzeżenie: (0%) ![]() ![]() |
Ostatnio po zainstalowaniu php 5.2 moj skrypt zaczał pracować niepoprawnie. Z początku zastanawiałem się dlaczego. Teraz wiem, że winowajcą jest wyrażenie regularne, w którym składnia inaczej działa na najnowszej wersji.
W changelgu znalazłem Cytat 3. A nasty bug was discovered in the handling of recursive patterns, that is, items such as (?R) or (?1), when the recursion could match a number of alternatives. If it matched one of the alternatives, but subsequently, outside the recursion, there was a failure, the code tried to back up into the recursion. However, because of the way PCRE is implemented, this is not possible, and the result was an incorrect result from the match. In order to prevent this happening, the specification of recursion has been changed so that all such subpatterns are automatically treated as atomic groups. Thus, for example, (?R) is treated as if it were (?>(?R)). Próbowałem przerobic wyrażenie na kilkanaście sposobów i wyszło że chyba jestem za głupi ;]. Czy ktoś jest w stanie poprawić ten kod?
Wszystko jest ok do momentu gdy użyję błędnego bbCode tj. np.
Wcześniej problem nie występował, kod po prostu sie nie parsował, teraz zamiast tej samej wartości funkcja preg_replace_callback() zwraca mi wartość pustą przez co cały bbCode znika. Jakieś pomysły? -------------------- Warsztat: Kubuntu, PhpStorm, Opera
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.08.2025 - 18:33 |