
704 So.2d 214 (1998)
McWHIRTER, REEVES, McGOTHLIN, DAVIDSON, RIEF & BAKAS, P.A., Appellant,
v.
Murray WEISS, Appellee.
No. 96-05163.
District Court of Appeal of Florida, Second District.
January 16, 1998.
*215 John W. Bakas, Jr., of McWhirter, Reeves, McGothlin, Davidson, Rief & Bakas, P.A., Tampa, for Appellant.
Andrew J. Nierenberg of Andrew J. Nierenberg, P.A., Miami, for Appellee.
PARKER, Chief Judge.
McWhirter, Reeves, McGothlin, Davidson, Rief & Bakas, P.A. (McWhirter, Reeves), plaintiff in the trial court, appeals the final summary judgment, the order granting defendant's motion to dismiss, and the order granting defendant's motion to strike, which collectively disposed of McWhirter, Reeves' action to recover compensation for legal services against Murray Weiss. We reverse this case; however, we do not comment upon the merits of McWhirter, Reeves' claim that Murray Weiss individually owes McWhirter, Reeves $127,000 in attorney fees, plus interest.
A recitation of the facts of this case is not necessary. It is clear from this record that the trial court reviewed pleadings filed in another case in Dade County Circuit Court to dismiss the complaint in this case based upon the doctrine of judicial estoppel. The trial court further compounded the problem by striking four counts in McWhirter, Reeves' amended complaint based upon the trial court's order granting the motion to dismiss. Both of these rulings were error, as was the summary judgment which was a product of the previous rulings.
A motion to dismiss, filed pursuant to Florida Rule of Civil Procedure 1.140(b)(6), tests the legal sufficiency of a complaint to state a cause of action and is not intended to determine issues of ultimate fact. See Holland v. Anheuser Busch, Inc., 643 So.2d 621, 623 (Fla. 2d DCA 1994). Therefore, in ruling on a motion to dismiss a complaint for failure to state cause of action, the trial court must confine itself strictly to the allegations within the four corners of the complaint. See Pizzi v. Central Bank & Trust Co., 250 So.2d 895, 897 (Fla.1971); Wausau Ins. Co. v. Haynes, 683 So.2d 1123, 1125 (Fla. 4th DCA 1996).
In Pizzi, the supreme court held that while a defendant may have affirmative defenses which would absolve it of all liability either in summary judgment proceedings or at trial, such defenses are not properly raised in a motion to dismiss under rule 1.140(b)(6) because they would require the court to look beyond the complaint. See Pizzi, 250 So.2d at 897. The only exception to this long-standing rule is found in Florida Rule of Civil Procedure 1.110(d), which states in relevant part: "Affirmative defenses appearing on the face of a prior pleading may be asserted as grounds for a motion or defense under rule 1.140(b)...."
Weiss never moved the Dade County pleadings into evidence; nor did the trial court properly take judicial notice of them. See §§ 90.202-.204, Fla. Stat. (1995); Livingston v. Spires, 481 So.2d 87, 88 (Fla. 1st DCA 1986). Thus, for the rule 1.110(d) exception to be applicable, McWhirter, Reeves' complaint, on its face, would have had to disclose *216 the prior, inconsistent pleadings which were subject to judicial estoppel. See Palmer v. McCallion, 645 So.2d 131, 133 (Fla. 4th DCA 1994). The complaint filed by McWhirter, Reeves makes no mention of the Dade County action.
Because the Dade County pleadings were not before the court on proper grounds, the trial court had no basis to determine the judicial estoppel issue. The trial court clearly exceeded its authority by looking beyond the complaint to grant Weiss's motion to dismiss for failure to state cause of action. See Holland, 643 So.2d at 623.
The trial court also erred in granting Weiss's motion to strike certain allegations in McWhirter, Reeves' amended complaint. The Rules of Civil Procedure provide two rules for striking a party's pleadings. See Fla. R. Civ. P. 1.140(f), 1.150. Because the court did not identify the rule or rules utilized to grant the motion, we shall discuss the rules that likely were used to strike each of the allegations.
With regard to paragraph 7, it is obvious that Weiss was relying on Florida Rule of Civil Procedure 1.140(f). Under rule 1.140(f): "A party may move to strike ... redundant, immaterial, impertinent, or scandalous matter from any pleading at any time." Fla. R. Civ. P. 1.140(f). "A motion to strike matter as redundant, immaterial or scandalous should only be granted if the material is wholly irrelevant, can have no bearing on the equities and no influence on the decision." Pentecostal Holiness Church, Inc. v. Mauney, 270 So.2d 762, 769 (Fla. 4th DCA 1972). Here, the allegations in paragraph 7 were relevant and definitely had a bearing on the equities. Therefore, paragraph 7 should not have been stricken.
With regard to paragraphs 8, 9, and 10 of the amended complaint, Weiss apparently was relying on rule 1.150, also known as the "sham pleadings rule," to strike these paragraphs. In a case very similar to this one, Sargent, Repka, Covert, Steen & Zimmet, P.A. v. HAMC Industries, Inc., 597 So.2d 427, 429 (Fla. 2d DCA 1992), this court stated:
Our supreme court has defined a sham pleading as one which "is palpably or inherently false, and from the plain or conceded facts in the case, must have been known to the party interposing it to be untrue." Rhea v. Hackney, 117 Fla. 62, 157 So. 190, 193 (1934). In reviewing a motion to strike pleadings, the "striking of pleadings is not favored and all doubts are to be resolved in favor of the pleadings." Costa Bella Dev. Corp. v. Costa Dev. Corp., 445 So.2d 1090, 1090 (Fla. 3d DCA 1984) (citations omitted). See also Ivey v. Southern States Power Co., 128 Fla. 345, 174 So. 834 (1937). A "[m]otion to strike a pleading admits the truth of all facts well pleaded." Ivey, 174 So. at 836 (citations omitted). Finally, in Scarfone v. Silverman, 408 So.2d 778 (Fla. 2d DCA 1982), this court concluded that when a party submits any evidence to support his allegations which directly contradicts the other party's position, the court cannot strike one party's pleadings simply because the opposing party says they are false.
In this case, the allegations in paragraphs 8, 9, and 10 of the amended complaint cannot be said to be "palpably or inherently false." Accordingly, the trial court erred in granting Weiss's motion to strike paragraphs 7, 8, 9, and 10 of McWhirter, Reeves' amended complaint.
Finally, the trial court erred in granting Weiss's motion for summary judgment. A trial court may consider matters extrinsic to the four corners of the complaint when ruling on a motion for summary judgment. See Pizzi, 250 So.2d at 895. Therefore, it would not have been improper for the trial court to consider the judicial estoppel issue in the summary judgment context.
However, the trial court, here, could not base its decision on judicial estoppel because all of the allegations potentially subject to judicial estoppel had been stricken by the court in its previous order. It was the absence of those allegations that led the trial court to conclude that there were no material issues of fact and that Weiss was entitled to judgment as a matter of law. Accordingly, where the order granting Weiss's motion to *217 strike was entered in error, so too was the summary judgment.
Reversed and remanded.
FRANK and WHATLEY, JJ., concur.
