WordPress.org

Making WordPress.org

Ticket #2229: 2229.1.diff

File 2229.1.diff, 12.4 KB (added by Thomas Vitale, 5 years ago)

Replace the _e() function with the esc_html_e() function on order to escape strings.

  • wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/budget-tool/main.php

    diff --git a/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/budget-tool/main.php b/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/budget-tool/main.php
    index d21f800..34659ff 100644
    a b wcb.editable = <?php echo json_encode( $editable ); ?>; 
    1919            <svg width="20" height="20" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"/></svg>
    2020            <?php endif; ?>
    2121
    22             <span>Preliminary Budget</span>
     22            <span><?php esc_html_e( 'Preliminary Budget', 'wordcamporg' ); ?></span>
    2323        </a>
    2424        <?php elseif ( $budget['status'] == 'approved' ) : ?>
    2525                <a href="<?php echo esc_url( add_query_arg( 'wcb-view', 'approved' ) ); ?>"
    2626            class="nav-tab <?php if ( $view == 'approved' ) { ?>nav-tab-active<?php } ?>">
    2727            <svg width="20" height="20" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"/></svg>
    2828
    29             <span>Approved Budget</span>
     29            <span><?php esc_html_e( 'Approved Budget', 'wordcamporg' ); ?></span>
    3030        </a>
    3131                <a href="<?php echo esc_url( add_query_arg( 'wcb-view', 'working' ) ); ?>"
    3232            class="nav-tab <?php if ( $view == 'working' ) { ?>nav-tab-active<?php } ?>">
    33             <span>Working Budget</span>
     33            <span><?php esc_html_e( 'Working Budget', 'wordcamporg' ); ?></span>
    3434        </a>
    3535        <?php endif; ?>
    36                 <!--<a href="#" class="nav-tab">Working Budget</a>-->
     36                <!--<a href="#" class="nav-tab"><?php esc_html_e( 'Working Budget', 'wordcamporg' ); ?></a>-->
    3737        </h2>
    3838
    3939    <?php if ( $budget['status'] == 'draft' ) : ?>
    40     <p style="max-width: 800px;">Welcome to your WordCamp budget, it's time to crunch some numbers! When you're done with the preliminary budget, hit the "Submit for Approval" button below – a WordCamp deputy will be notified and will review your work. If you're having trouble with these numbers, or if you have any questions, don't hesitate to reach out to your mentor or Central.</p>
     40    <p style="max-width: 800px;"><?php esc_html_e( 'Welcome to your WordCamp budget, it\'s time to crunch some numbers! When you\'re done with the preliminary budget, hit the "Submit for Approval" button below – a WordCamp deputy will be notified and will review your work. If you\'re having trouble with these numbers, or if you have any questions, don\'t hesitate to reach out to your mentor or Central.', 'wordcamporg' ); ?></p>
    4141    <?php elseif ( $budget['status'] == 'pending' ) : ?>
    42     <p style="max-width: 800px;">This budget has been submitted for approval. You will be notified when it is approved. Or not.</p>
     42    <p style="max-width: 800px;"><?php esc_html_e( 'This budget has been submitted for approval. You will be notified when it is approved. Or not.', 'wordcamporg' ); ?></p>
    4343    <?php elseif ( $budget['status'] == 'approved' && $view == 'approved' ) : ?>
    44     <p style="max-width: 800px;">This budget has been approved and can not be modified. Use the working budget if you'd like to play around with numbers.</p>
     44    <p style="max-width: 800px;"><?php esc_html_e( 'This budget has been approved and can not be modified. Use the working budget if you\'d like to play around with numbers.', 'wordcamporg' ); ?></p>
    4545    <?php elseif ( $view == 'working' ) : ?>
    46     <p style="max-width: 800px;">Welcome to your working budget. Feel free to play around with numbers here. They will not affect your approved budget.</p>
     46    <p style="max-width: 800px;"><?php esc_html_e( 'Welcome to your working budget. Feel free to play around with numbers here. They will not affect your approved budget.', 'wordcamporg' ); ?></p>
    4747    <?php endif; ?>
    4848
    4949    <div class="left">
    50         <h2>Event Data</h2>
     50        <h2><?php esc_html_e( 'Event Data', 'wordcamporg' ); ?></h2>
    5151        <table class="wcb-budget-container">
    5252            <tbody>
    5353                <tr class="wcb-group-header">
    54                     <th style="width: 50%;">Name</th>
    55                     <th style="width: 50%;">Value</th>
     54                    <th style="width: 50%;"><?php esc_html_e( 'Name', 'wordcamporg' ); ?></th>
     55                    <th style="width: 50%;"><?php esc_html_e( 'Value', 'wordcamporg' ); ?></th>
    5656                </tr>
    5757                <tr class="wcb-meta-placeholder" style="display: none;">
    5858                    <td colspan="2"></td>
    wcb.editable = <?php echo json_encode( $editable ); ?>; 
    6161        </table>
    6262    </div>
    6363    <div class="right">
    64         <h2>Summary</h2>
     64        <h2><?php esc_html_e( 'Summary', 'wordcamporg' ); ?></h2>
    6565        <div class="wcb-summary-placeholder"></div>
    6666    </div>
    6767
    6868    <div class="clear"></div>
    6969
    70     <h2>Expenses</h2>
     70    <h2><?php esc_html_e( 'Expenses', 'wordcamporg' ); ?></h2>
    7171    <table class="wcb-budget-container">
    7272        <tbody>
    7373            <tr class="wcb-group-header">
    74                 <th style="width: 20%;">Category</th>
    75                 <th style="width: 40%;">Detail</th>
    76                 <th style="width: 25%;" class="amount">Amount</th>
     74                <th style="width: 20%;"><?php esc_html_e( 'Category', 'wordcamporg' ); ?></th>
     75                <th style="width: 40%;"><?php esc_html_e( 'Detail', 'wordcamporg' ); ?></th>
     76                <th style="width: 25%;" class="amount"><?php esc_html_e( 'Amount', 'wordcamporg' ); ?></th>
    7777                <th style="width: 15%;"></th>
    7878            </tr>
    7979
    8080            <tr class="wcb-expense-placeholder">
    8181                <?php if ( $editable ) : ?>
    82                 <td colspan="4">New Expense Item</td>
     82                <td colspan="4"><?php esc_html_e( 'New Expense Item', 'wordcamporg' ); ?></td>
    8383                <?php endif; ?>
    8484            </tr>
    8585        </tbody>
    8686    </table>
    8787
    88     <h2>Income</h2>
     88    <h2><?php esc_html_e( 'Income', 'wordcamporg' ); ?></h2>
    8989    <table class="wcb-budget-container">
    9090        <tbody>
    9191            <tr class="wcb-group-header">
    92                 <th style="width: 20%;">Category</th>
    93                 <th style="width: 40%;">Detail</th>
    94                 <th style="width: 25%;" class="amount">Amount</th>
     92                <th style="width: 20%;"><?php esc_html_e( 'Category', 'wordcamporg' ); ?></th>
     93                <th style="width: 40%;"><?php esc_html_e( 'Detail', 'wordcamporg' ); ?></th>
     94                <th style="width: 25%;" class="amount"><?php esc_html_e( 'Amount', 'wordcamporg' ); ?></th>
    9595                <th style="width: 15%;"></th>
    9696            </tr>
    9797
    9898            <tr class="wcb-income-placeholder">
    9999                <?php if ( $editable ) : ?>
    100                 <td colspan="4">New Income Item</td>
     100                <td colspan="4"><?php esc_html_e( 'New Income Item', 'wordcamporg' ); ?></td>
    101101                <?php endif; ?>
    102102            </tr>
    103103        </tbody>
    wcb.editable = <?php echo json_encode( $editable ); ?>; 
    109109
    110110        <?php if ( $budget['status'] == 'draft' ) : ?>
    111111        <p class="submit">
    112             <?php submit_button( 'Save Draft', 'secondary', 'wcb-budget-save-draft', false ); ?>
    113             <?php submit_button( 'Save &amp; Request Review', 'secondary', 'wcb-budget-request-review', false ); ?>
    114             <a href="<?php echo admin_url( 'admin.php?page=wordcamp-budget' ); ?>" class="button">Cancel Changes</a>
    115             <?php submit_button( 'Submit for Approval', 'primary', 'wcb-budget-submit', false ); ?>
     112            <?php submit_button( __( 'Save Draft', 'wordcamporg' ), 'secondary', 'wcb-budget-save-draft', false ); ?>
     113            <?php submit_button( __( 'Save &amp; Request Review', 'wordcamporg' ), 'secondary', 'wcb-budget-request-review', false ); ?>
     114            <a href="<?php echo admin_url( 'admin.php?page=wordcamp-budget' ); ?>" class="button"><?php esc_html_e( 'Cancel Changes', 'wordcamporg' ); ?></a>
     115            <?php submit_button( __( 'Submit for Approval', 'wordcamporg' ), 'primary', 'wcb-budget-submit', false ); ?>
    116116        </p>
    117117        <?php elseif ( $budget['status'] == 'pending' && current_user_can( 'wcb_approve_budget' ) ) : ?>
    118118        <p class="submit">
    119             <?php submit_button( 'Approve', 'primary', 'wcb-budget-approve', false ); ?>
    120             <?php submit_button( 'Reject', 'primary', 'wcb-budget-reject', false ); ?>
     119            <?php submit_button( __( 'Approve', 'wordcamporg' ), 'primary', 'wcb-budget-approve', false ); ?>
     120            <?php submit_button( __( 'Reject', 'wordcamporg' ), 'primary', 'wcb-budget-reject', false ); ?>
    121121        </p>
    122122        <?php elseif ( $budget['status'] == 'approved' && $view == 'working' ) : ?>
    123123        <p class="submit">
    124             <?php submit_button( 'Update Working Budget', 'primary', 'wcb-budget-update-working', false ); ?>
    125             <a href="<?php echo admin_url( 'admin.php?page=wordcamp-budget&wcb-view=working' ); ?>" class="button">Cancel Changes</a>
    126             <?php submit_button( 'Reset to Approved Budget', 'secondary', 'wcb-budget-reset', false ); ?>
     124            <?php submit_button( __( 'Update Working Budget', 'wordcamporg' ), 'primary', 'wcb-budget-update-working', false ); ?>
     125            <a href="<?php echo admin_url( 'admin.php?page=wordcamp-budget&wcb-view=working' ); ?>" class="button"><?php esc_html_e( 'Cancel Changes', 'wordcamporg' ); ?></a>
     126            <?php submit_button( __( 'Reset to Approved Budget', 'wordcamporg' ), 'secondary', 'wcb-budget-reset', false ); ?>
    127127        </p>
    128128        <?php endif; ?>
    129129    </form>
    wcb.editable = <?php echo json_encode( $editable ); ?>; 
    136136            <th style="width: 50%;"></th>
    137137        </tr>
    138138        <tr>
    139             <td>Income</td>
     139            <td><?php esc_html_e( 'Income', 'wordcamporg' ); ?></td>
    140140            <td class="amount">{{data.income}}</td>
    141141        </tr>
    142142        <tr>
    143             <td>Expenses</td>
     143            <td><?php esc_html_e( 'Expenses', 'wordcamporg' ); ?></td>
    144144            <td class="amount">{{data.expenses}}</td>
    145145        </tr>
    146146        <tr>
    147             <td>Variance</td>
     147            <td><?php esc_html_e( 'Variance', 'wordcamporg' ); ?></td>
    148148            <td class="amount <# if (data.variance_raw < 0) { #>wcb-negative<# } #>">{{data.variance}}</td>
    149149        </tr>
    150150        <tr>
    151             <td>Cost Per Person Per Day</td>
     151            <td><?php esc_html_e( 'Cost Per Person Per Day', 'wordcamporg' ); ?></td>
    152152            <td class="amount">{{data.per_person}}</td>
    153153        </tr>
    154154        <tr>
    wcb.editable = <?php echo json_encode( $editable ); ?>; 
    163163            <td></td>
    164164            <td class="amount">
    165165                <# if (data.variance_raw < 0) { #>
    166                 <a href="#" target="_blank" class="inspire">inspire me</a>
     166                <a href="#" target="_blank" class="inspire"><?php esc_html_e( 'inspire me', 'wordcamporg' ); ?></a>
    167167                <# } #>
    168168            </td>
    169169        </tr>
    wcb.editable = <?php echo json_encode( $editable ); ?>; 
    209209            </td>
    210210            <# } else { #>
    211211            <td style="width: 20%">
    212                 Income
     212                <?php esc_html_e( 'Income', 'wordcamporg' ); ?>
    213213                <input type="hidden" class="category" value="{{data.category}}" />
    214214            </td>
    215215            <# } #>
    wcb.editable = <?php echo json_encode( $editable ); ?>; 
    218218            <# if (data.type == 'expense') { #>
    219219                {{wcb.categories[data.category]}}
    220220            <# } else { #>
    221                 Income
     221                <?php esc_html_e( 'Income', 'wordcamporg' ); ?>
    222222            <# } #>
    223223            </td>
    224224        <# } #>
    wcb.editable = <?php echo json_encode( $editable ); ?>; 
    274274
    275275        <td style="width: 15%" class="actions">
    276276            <# if (wcb.editable) { #>
    277             <a href="#" class="move">Move</a>
    278             <a href="#" class="delete">Delete</a>
     277            <a href="#" class="move"><?php esc_html_e( 'Move', 'wordcamporg' ); ?></a>
     278            <a href="#" class="delete"><?php esc_html_e( 'Delete', 'wordcamporg' ); ?></a>
    279279            <# } #>
    280280        </td>
    281281    <# } #>