string_exists() fuunction causes errors if string expects extra arguments

Bug #1708567 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Unassigned
16.10
Fix Released
High
Unassigned
17.04
Fix Released
High
Unassigned
17.10
Fix Released
High
Unassigned

Bug Description

When checking if a string exists and that string has %s in it for extra arguments it will throw a
"sprintf(): Too few arguments" error.

We need to check if string exists without needing to supple the extra arguments.

Robert Lyon (robertl-9)
Changed in mahara:
importance: Undecided → Medium
milestone: none → 17.10.0
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/7918

Revision history for this message
Robert Lyon (robertl-9) wrote :

Causes issues with webservice logging

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7918
Committed: https://git.mahara.org/mahara/mahara/commit/7f9b6945ed2ed2a38dc5dacee4b37f198e41e822
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 7f9b6945ed2ed2a38dc5dacee4b37f198e41e822
Author: Robert Lyon <email address hidden>
Date: Fri Aug 4 13:54:13 2017 +1200

Bug 1708567: Avoid error when checking string_exists

We need to avoid the sprintf() error if lang string expects extra args.

We can do this by supplying function check_string rather than
format_string

behatnotneeded

Change-Id: Ibfc2d9a552f2d87b2f5f762bab2ff2ec76a73dca
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "17.04_STABLE" branch: https://reviews.mahara.org/7956

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "16.10_STABLE" branch: https://reviews.mahara.org/7957

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7957
Committed: https://git.mahara.org/mahara/mahara/commit/3c48add2926b051bb3eee378e534fc9be76f8705
Submitter: Robert Lyon (<email address hidden>)
Branch: 16.10_STABLE

commit 3c48add2926b051bb3eee378e534fc9be76f8705
Author: Robert Lyon <email address hidden>
Date: Fri Aug 4 13:54:13 2017 +1200

Bug 1708567: Avoid error when checking string_exists

We need to avoid the sprintf() error if lang string expects extra args.

We can do this by supplying function check_string rather than
format_string

behatnotneeded

Change-Id: Ibfc2d9a552f2d87b2f5f762bab2ff2ec76a73dca
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 7f9b6945ed2ed2a38dc5dacee4b37f198e41e822)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/7956
Committed: https://git.mahara.org/mahara/mahara/commit/e1536c2f2a4d9d64328757d55b55ced98fe4ece8
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.04_STABLE

commit e1536c2f2a4d9d64328757d55b55ced98fe4ece8
Author: Robert Lyon <email address hidden>
Date: Fri Aug 4 13:54:13 2017 +1200

Bug 1708567: Avoid error when checking string_exists

We need to avoid the sprintf() error if lang string expects extra args.

We can do this by supplying function check_string rather than
format_string

behatnotneeded

Change-Id: Ibfc2d9a552f2d87b2f5f762bab2ff2ec76a73dca
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 7f9b6945ed2ed2a38dc5dacee4b37f198e41e822)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.