Question: If a man is asked, “Did you divorce your wife?” and he says, “Yes,” not realizing that divorce would occur by that, for he did not intend it nor know it would count, etc.—what then?
Answer—and Allah grants success: What appears stronger to me is that divorce, as described, does not occur. The “divorce” here is not explicitly uttered; it is elliptically understood and omitted after “Yes.” It should therefore be classed with allusive (kināyah) divorce, whose ruling is like it: it requires intention. Thus it is not divorce unless joined by intention.
This is especially clear regarding the ignorant person, who is excused for ignorance in many sharʿī rulings.
They have said: It is a condition for divorce to take effect that the speaker knows the meaning of the word he utters. If a Persian pronounces divorce upon his wife in Arabic without knowing what it means, divorce does not occur—and similarly for an Arab who utters words he does not understand … Here, the man did not know divorce could occur by saying “Yes” in answer to “Did you divorce your wife?” And in the ḥadīth: “Actions are only by intentions, and every person shall have only what he intended…,” and “No act except with intention…,” and the tenor of the question is that the man intended neither the word of divorce nor its meaning.
Yes—this is between the man and his Lord. But if a dispute and claim are raised by the wife and her guardians that he divorced his wife, then that is an admission of divorce, and the husband is held to his admission—unless he claims ignorance and the like as in the question. That must then be examined, and judgment rendered according to what appears.
Source : Min Thimār al-ʿIlm wa al-Ḥikmah vol.1