Fossil SCM
Ensure that the legacy /attachadd form redirects back to the page for the attachment's target unless it's told otherwise via ?from=X.
Commit
dab3d6817f874ef1cc17564311b248cee0f948e34d9bfb473821d02d5ac620e9
Parent
9ea044d982d4bc4…
1 file changed
+6
-3
+6
-3
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -1090,13 +1090,15 @@ | ||
| 1090 | 1090 | @ <p class="generalError">Error: Incorrect security code.</p> |
| 1091 | 1091 | } |
| 1092 | 1092 | @ <h2>Attachments for %s(zTargetType)</h2> |
| 1093 | 1093 | attachment_list(zTarget, NULL, |
| 1094 | 1094 | ATTACHLIST_SIZE | ATTACHLIST_HIDE_UNAPPROVED); |
| 1095 | - attach_render_legacy_form(noJsArgs[0], noJsArgs[1], noJsArgs[2], | |
| 1096 | - noJsArgs[3], 0, | |
| 1097 | - zFrom ? zFrom : mprintf("%R/home")); | |
| 1095 | + attach_render_legacy_form( | |
| 1096 | + noJsArgs[0], noJsArgs[1], noJsArgs[2], | |
| 1097 | + noJsArgs[3], 0, | |
| 1098 | + zFrom ? zFrom : (zTo ? zTo : (zTo=mprintf("%R/home"))) | |
| 1099 | + ); | |
| 1098 | 1100 | @ <div id='attachadd-form-wrapper' class='hidden'> |
| 1099 | 1101 | /* fossil.attach.js populates this DIV with the attachment widget, |
| 1100 | 1102 | ** imports these hidden fields, and removes the legacy form. */ |
| 1101 | 1103 | @ <input type="hidden" name="target" value="%h(zTarget)"> |
| 1102 | 1104 | if( zFrom ){ |
| @@ -1111,10 +1113,11 @@ | ||
| 1111 | 1113 | builtin_fossil_js_bundle_or("attach", NULL); |
| 1112 | 1114 | db_end_transaction(0); |
| 1113 | 1115 | style_finish_page(); |
| 1114 | 1116 | fossil_free(zTargetType); |
| 1115 | 1117 | fossil_free(zExtraFree); |
| 1118 | + fossil_free(zTo); | |
| 1116 | 1119 | } |
| 1117 | 1120 | |
| 1118 | 1121 | /* |
| 1119 | 1122 | ** WEBPAGE: ainfo |
| 1120 | 1123 | ** URL: /ainfo?name=ARTIFACTID |
| 1121 | 1124 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -1090,13 +1090,15 @@ | |
| 1090 | @ <p class="generalError">Error: Incorrect security code.</p> |
| 1091 | } |
| 1092 | @ <h2>Attachments for %s(zTargetType)</h2> |
| 1093 | attachment_list(zTarget, NULL, |
| 1094 | ATTACHLIST_SIZE | ATTACHLIST_HIDE_UNAPPROVED); |
| 1095 | attach_render_legacy_form(noJsArgs[0], noJsArgs[1], noJsArgs[2], |
| 1096 | noJsArgs[3], 0, |
| 1097 | zFrom ? zFrom : mprintf("%R/home")); |
| 1098 | @ <div id='attachadd-form-wrapper' class='hidden'> |
| 1099 | /* fossil.attach.js populates this DIV with the attachment widget, |
| 1100 | ** imports these hidden fields, and removes the legacy form. */ |
| 1101 | @ <input type="hidden" name="target" value="%h(zTarget)"> |
| 1102 | if( zFrom ){ |
| @@ -1111,10 +1113,11 @@ | |
| 1111 | builtin_fossil_js_bundle_or("attach", NULL); |
| 1112 | db_end_transaction(0); |
| 1113 | style_finish_page(); |
| 1114 | fossil_free(zTargetType); |
| 1115 | fossil_free(zExtraFree); |
| 1116 | } |
| 1117 | |
| 1118 | /* |
| 1119 | ** WEBPAGE: ainfo |
| 1120 | ** URL: /ainfo?name=ARTIFACTID |
| 1121 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -1090,13 +1090,15 @@ | |
| 1090 | @ <p class="generalError">Error: Incorrect security code.</p> |
| 1091 | } |
| 1092 | @ <h2>Attachments for %s(zTargetType)</h2> |
| 1093 | attachment_list(zTarget, NULL, |
| 1094 | ATTACHLIST_SIZE | ATTACHLIST_HIDE_UNAPPROVED); |
| 1095 | attach_render_legacy_form( |
| 1096 | noJsArgs[0], noJsArgs[1], noJsArgs[2], |
| 1097 | noJsArgs[3], 0, |
| 1098 | zFrom ? zFrom : (zTo ? zTo : (zTo=mprintf("%R/home"))) |
| 1099 | ); |
| 1100 | @ <div id='attachadd-form-wrapper' class='hidden'> |
| 1101 | /* fossil.attach.js populates this DIV with the attachment widget, |
| 1102 | ** imports these hidden fields, and removes the legacy form. */ |
| 1103 | @ <input type="hidden" name="target" value="%h(zTarget)"> |
| 1104 | if( zFrom ){ |
| @@ -1111,10 +1113,11 @@ | |
| 1113 | builtin_fossil_js_bundle_or("attach", NULL); |
| 1114 | db_end_transaction(0); |
| 1115 | style_finish_page(); |
| 1116 | fossil_free(zTargetType); |
| 1117 | fossil_free(zExtraFree); |
| 1118 | fossil_free(zTo); |
| 1119 | } |
| 1120 | |
| 1121 | /* |
| 1122 | ** WEBPAGE: ainfo |
| 1123 | ** URL: /ainfo?name=ARTIFACTID |
| 1124 |